Пример #1
0
        public Boolean ProcessUpperCommand()
        {
            if (!Const.PopupMenuEnabled)
            {
                return(false);
            }

            TableViewModel tvm       = (this.DataContext as TableViewModel);
            Boolean        processed = false;

            switch (upperSelected)
            {
            case (Command.Left):
                tvm.MainPageViewModel.SheetViewModel.BringFront(ColumnViewModel);
                tvm.MainPageViewModel.ReflectAll(ReflectReason.ColumnShown);
                UpperLeftMenuElement.Unhighlight();
                tvm.CancelIndexing(true);
                processed = true;
                break;

            case (Command.Right):
                tvm.MainPageViewModel.SheetViewModel.SetAside(ColumnViewModel);
                tvm.MainPageViewModel.ReflectAll(ReflectReason.ColumnHidden);
                UpperRightMenuElement.Unhighlight();
                tvm.CancelIndexing(true);
                processed = true;
                break;

            case (Command.Down):
                tvm.MainPageViewModel.SheetViewModel.Sort(ColumnViewModel, SortOption.Ascending);
                tvm.MainPageViewModel.ReflectAll(ReflectReason.ColumnSorted);
                UpperDownMenuElement.Unhighlight();
                tvm.CancelIndexing(true);
                processed = true;
                break;
            }

            upperSelected = Command.None;
            UpperDownMenuElement.Hide();
            UpperLeftMenuElement.Hide();
            UpperRightMenuElement.Hide();
            return(processed);
        }
Пример #2
0
        void UnhighlightUpperMenu(Command command)
        {
            switch (command)
            {
            case Command.Down:
                UpperDownMenuElement.Unhighlight();
                break;

            case Command.Left:
                UpperLeftMenuElement.Unhighlight();
                break;

            case Command.Right:
                UpperRightMenuElement.Unhighlight();
                break;

            case Command.None:
                UpperDownMenuElement.Unhighlight();
                UpperLeftMenuElement.Unhighlight();
                UpperRightMenuElement.Unhighlight();
                break;
            }
        }