private void MenuItemCommandAction(object parameter)
        {
            BurgerMenuItem item = parameter as BurgerMenuItem;

            if (item != null)
            {
                App.AppLogger.Logger.Log(devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.VerboseHigh | devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.Information, "Burger menu item clicked '{0}'.", item.Key);

                //determine what type this type is before performing any actions
                if (item.GetType() == typeof(BurgerMenuViewItem))
                {
                    App.Controller.NavigateTo(item.Key);
                }
                else if (item.GetType() == typeof(BurgerMenuPopupViewItem))
                {
                    App.Controller.ShowPopup(item.Key);
                }
                else if (item.GetType() == typeof(BurgerMenuCommandItem))
                {
                    BurgerMenuCommandItem commandItem      = item as BurgerMenuCommandItem;
                    BurgerMenuViewItem    selectedViewItem = SelectedItem as BurgerMenuViewItem;
                    View viewInstance = selectedViewItem.PageViewInstance;
                    commandItem.Invoke(viewInstance.BindingContext, new object[] { null });
                }
                IsMenuExpanded = false;
            }
        }
示例#2
0
        public BurgerMenuCommandItem AddChildCommandItem(string key,
                                                         string menuTitle,
                                                         CachyFont.Glyph glyph,
                                                         string methodName)
        {
            BurgerMenuCommandItem commandItem = new BurgerMenuCommandItem(string.Format("{0}.{1}", Key, key),
                                                                          menuTitle,
                                                                          glyph,
                                                                          this,
                                                                          methodName);

            ChildItems.Add(commandItem);
            return(commandItem);
        }
示例#3
0
 public BurgerMenuCommandItem AddChildCommandItem(BurgerMenuCommandItem item)
 {
     ChildItems.Add(item);
     return(item);
 }