Esempio n. 1
0
        private void ShowPopupMenu(MenuItemModel menuItem)
        {
            bool wasAnotherMenuSelected = HasCurrentMenu;

            CurrentMenu = menuItem;

            double menuLeft = 64.0 * menuItem.Position,
                   maxLeft = MenuItemsControl.Width - PopupMenu.Width;

            PopupMenu.Margin = new Thickness(Math.Min(menuLeft, maxLeft), 0.0, 0.0, 0.0);

            if (!wasAnotherMenuSelected)
            {
                AnimatePopupMenuHeight(0.0, 336.0, ShowAnimationDurationMs, () => { });
            }
        }
Esempio n. 2
0
        private void SelectMenuItem(MenuItemModel menuItem)
        {
            foreach (var item in AppMenuItems.MenuItems)
            {
                item.IsSelected = false;
            }

            if (menuItem != null)
            {
                menuItem.IsSelected = true;
            }
        }