public void AddMenuItem(string i_MenuItemTitle, ClickInvoker i_FunctionToAdd) { //// Adds new item to the menu - gets item name, and function to do //// Add the item to next available index in menu MenuItems.Add(new MenuItem(Index++, i_MenuItemTitle, i_FunctionToAdd)); }
public MainPage() { this.InitializeComponent(); // Instantiate lists and stacks to keep track of the state _shapeList = new List <PaintBase>(); _undoStack = new Stack <List <PaintBase> >(); _redoStack = new Stack <List <PaintBase> >(); // Initialize invokers for the command pattern _canvasInvoker = new ClickInvoker(); _userInvoker = new UserActionInvoker(); // Set initial selection to circle CircleToggle.IsChecked = true; _cmd = new DrawShapeCommand(this) { ShapeType = CircleShape.Instance }; // Set canvas Z indici Canvas.SetZIndex(BottomPanel, 100); Canvas.SetZIndex(TopBar, 100); Canvas.SetZIndex(ShapeList, 100); }
internal MenuItem(int i_Index, string i_Title, ClickInvoker i_Clicked) { r_Index = i_Index; m_Title = i_Title; Clicked += i_Clicked; }