StoryTeller.UserInterface.Controls.CommandMenuItem.Build C# (CSharp) Method

Build() public static method

public static Build ( ScreenAction screenAction ) : System.Windows.Controls.MenuItem
screenAction StoryTeller.UserInterface.Actions.ScreenAction
return System.Windows.Controls.MenuItem
        public static MenuItem Build(ScreenAction screenAction)
        {
            var item = new MenuItem()
            {
                //Header = new DockPanel().Left<Label>(x => x.Content = screenAction.Name),
                Header = screenAction.Name,
                InputGestureText = screenAction.KeyString,
                Tag = screenAction,
                Command = screenAction.Command
            };

            item.Icon = new Image().Configure(x => x.SetIcon(screenAction.Icon));

            return item;
        }

Usage Example

Beispiel #1
0
 public void Refill(IEnumerable <ScreenAction> actions)
 {
     ContextMenu.Items.Clear();
     actions.Each(x =>
     {
         var item = CommandMenuItem.Build(x);
         ContextMenu.Items.Add(item);
     });
 }
CommandMenuItem