Inheritance: Xwt.WPFBackend.Backend, IMenuBackend
Exemple #1
0
        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;
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        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;
        }
Exemple #4
0
        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;
        }
Exemple #5
0
		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;
		}
Exemple #6
0
        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;
        }