Esempio n. 1
0
        public MenuViewModel()
        {
            this._items = new MenuItemsCollection();

            //The command is used in the Configuration example for notifying when element with children has been clicked.
            this.notifyOnClickCommand = new DelegateCommand(this.NotifyOnClickExecuted);
        }
Esempio n. 2
0
        private void GenerateMenuItems()
        {
            MainMenu = new Dictionary <string, List <MenuItemCatalog> >()
            {
                { "Аналитика", Analytics.MenuItems.ItemsCatalog },
                { "Справочники", CatalogSelector.ItemsCatalog },
                { "Заказы", CatalogSelector.OrderItemsCatalog },
                { "Отчеты", CatalogSelector.ReportsCatalog },
                { "Импорт", CatalogSelector.ImportItemsCatalog },
                { "Пользователи", CatalogSelector.UserItemsCatalog },
            };


            _items = new MenuItemsCollection();
            foreach (var n in MainMenu)
            {
                var menuItem = new MenuItem(n.Key);
                foreach (var itm in n.Value)
                {
                    if (itm.IsVisible)
                    {
                        menuItem.Items.Add(itm);
                    }
                }
                if (menuItem.Items.Count > 0)
                {
                    _items.Add(menuItem);
                }
            }



            /*
             * var Cats = new MenuItem("Справочники");
             * foreach (var itm in CatalogSelector.ItemsCatalog)
             * {
             *  if (itm.IsVisible)
             *  {
             *      Cats.Items.Add(itm);
             *  }
             * }
             * if (Cats.Items.Count > 0)
             * {
             *  _items.Add(Cats);
             * }
             *
             *
             * var pOrders = new MenuItem("Заказы");
             * foreach (var itm in CatalogSelector.OrderItemsCatalog)
             * {
             *  if (itm.IsVisible)
             *  {
             *      pOrders.Items.Add(itm);
             *  }
             * }
             * if (pOrders.Items.Count > 0)
             * {
             *  _items.Add(pOrders);
             * }
             *
             * var pReps = new MenuItem("Отчеты");
             * foreach (var itm in CatalogSelector.ReportsCatalog)
             * {
             *  if (itm.IsVisible)
             *  {
             *      pReps.Items.Add(itm);
             *  }
             * }
             * if (pReps.Items.Count > 0)
             * {
             *  _items.Add(pReps);
             * }
             *
             * var pUser = new MenuItem("Пользователи");
             * foreach (var itm in CatalogSelector.UserItemsCatalog)
             * {
             *  if (itm.IsVisible)
             *  {
             *      pUser.Items.Add(itm);
             *  }
             * }
             * if (pUser.Items.Count > 0)
             * {
             *  _items.Add(pUser);
             * }
             *
             */
        }
Esempio n. 3
0
 public MenuItem(string text)
 {
     Text       = text;
     this.items = new MenuItemsCollection(this);
 }
Esempio n. 4
0
 public MenuItem()
 {
     this.items = new MenuItemsCollection(this);
 }