Пример #1
0
        public BurgerMenuPopupViewItem AddChildPopupItem(string key,
                                                         Type pageViewType)
        {
            BurgerMenuPopupViewItem popupItem = new BurgerMenuPopupViewItem(string.Format("{0}.{1}", Key, key),
                                                                            pageViewType);

            ChildItems.Add(popupItem);
            return(popupItem);
        }
Пример #2
0
        public void SelectPopup(BurgerMenuPopupViewItem item)
        {
            App.AppLogger.Logger.Log(devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.VerboseHigh | devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.Information, "Selecting burger menu popup '{0}'.", item.Key);

            _selectedPopupItem = item;
            OnPropertyChanged("SelectedPopupItem");
            _popups.Push(item);
            ShowPopup = true;
        }
Пример #3
0
        public void ClosePopup()
        {
            App.AppLogger.Logger.Log(devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.VerboseHigh | devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.Information, "Closing buger menu popup.");

            _popups.Pop();
            _selectedPopupItem = _popups.Count > 0 ? _popups.Peek() : null;
            OnPropertyChanged("SelectedPopupItem");
            ShowPopup = _selectedPopupItem != null;
        }
Пример #4
0
        public void DisplayPopup(string key,
                                 out BurgerMenuPopupViewItem item)
        {
            App.AppLogger.Logger.Log(devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.VerboseHigh | devoctomy.DFramework.Logging.Interfaces.LoggerMessageType.Information, "Displaying burger menu popup '{0}'.", key);

            item = null;
            if (_menuItemsByKey.ContainsKey(key))
            {
                item = _menuItemsByKey[key] as BurgerMenuPopupViewItem;
                if (item != null)
                {
                    SelectPopup(item);
                }
                else
                {
                    throw new InvalidOperationException(String.Format("Cannot display popup '{0}' as it is of the wrong type.", key));
                }
            }
            else
            {
                throw new KeyNotFoundException(String.Format("Burger menu item with the key '{0}' was not found.", key));
            }
        }