Ejemplo 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, () => { });
            }
        }
Ejemplo n.º 2
0
        private void SelectMenuItem(MenuItemModel menuItem)
        {
            foreach (var item in AppMenuItems.MenuItems)
            {
                item.IsSelected = false;
            }

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