public void SetSubmenu(IMenuBackend menu) { if (menu == null) { item.Items.Clear(); if (subMenu != null) { subMenu.RemoveFromParentItem(); subMenu = null; } return; } var menuBackend = (MenuBackend)menu; menuBackend.RemoveFromParentItem(); foreach (var itemBackend in menuBackend.Items) { item.Items.Add(itemBackend.MenuItem); } menuBackend.ParentItem = this; subMenu = menuBackend; }
public void SetMainMenu(IMenuBackend menu) { if (mainMenu != null) { mainMenuBackend.ParentWindow = null; rootPanel.Children.Remove(mainMenu); } if (menu == null) { mainMenu = null; mainMenuBackend = null; return; } var menuBackend = (MenuBackend)menu; var m = new System.Windows.Controls.Menu(); foreach (var item in menuBackend.Items) { m.Items.Add(item.Item); } Grid.SetColumn(m, 0); Grid.SetRow(m, 0); rootPanel.Children.Add(m); mainMenu = m; mainMenuBackend = menuBackend; mainMenuBackend.ParentWindow = this; }
public void SetMainMenu(IMenuBackend menu) { if (menu == null) { if (mainMenu != null) { rootPanel.Children.Remove(mainMenu); mainMenu = null; mainMenuBackend = null; } return; } var menuBackend = (MenuBackend)menu; var m = new System.Windows.Controls.Menu(); foreach (var item in menuBackend.Items) { m.Items.Add(item.MenuItem); } rootPanel.Children.Add(m); mainMenu = m; mainMenuBackend = menuBackend; }
public void SetMainMenu(IMenuBackend menu) { if (menu == null) { if (mainMenu != null) { rootPanel.Children.Remove (mainMenu); mainMenu = null; mainMenuBackend = null; } return; } var menuBackend = (MenuBackend)menu; var m = new System.Windows.Controls.Menu (); foreach (var item in menuBackend.Items) m.Items.Add (item.MenuItem); rootPanel.Children.Add (m); mainMenu = m; mainMenuBackend = menuBackend; }
public void SetMainMenu (IMenuBackend menu) { if (mainMenu != null) { mainMenuBackend.ParentWindow = null; rootPanel.Children.Remove (mainMenu); } if (menu == null) { mainMenu = null; mainMenuBackend = null; return; } var menuBackend = (MenuBackend)menu; var m = new System.Windows.Controls.Menu (); foreach (var item in menuBackend.Items) m.Items.Add (item.Item); Grid.SetColumn (m, 0); Grid.SetRow (m, 0); rootPanel.Children.Add (m); mainMenu = m; mainMenuBackend = menuBackend; mainMenuBackend.ParentWindow = this; }
public void SetSubmenu(IMenuBackend menu) { if (menu == null) { this.menuItem.Items.Clear (); if (subMenu != null) { subMenu.RemoveFromParentItem (); subMenu = null; } return; } var menuBackend = (MenuBackend)menu; menuBackend.RemoveFromParentItem (); foreach (var itemBackend in menuBackend.Items) this.menuItem.Items.Add (itemBackend.Item); menuBackend.ParentItem = this; subMenu = menuBackend; }