private static void OnCanShowPopupItem(object sender, CanExecuteRoutedEventArgs e)
        {
            PopupStackControl stackControl = (PopupStackControl)sender;

            e.CanExecute = e.Parameter is PopupItem item && !stackControl.Contains(item);
            e.Handled    = true;
        }
        private static void OnShowPopupItem(object sender, ExecutedRoutedEventArgs e)
        {
            PopupStackControl stackControl = (PopupStackControl)sender;

            stackControl.Show((PopupItem)e.Parameter);
            e.Handled = true;
        }
        private static void OnClosePopupItem(object sender, ExecutedRoutedEventArgs e)
        {
            PopupStackControl stackControl = (PopupStackControl)sender;

            stackControl.Close(e.Parameter as PopupItem);
            e.Handled = true;
        }
Пример #4
0
        public PopupStack(PopupStackControl popupStackControl)
        {
            if (popupStackControl == null)
            {
                throw new ArgumentNullException(nameof(popupStackControl));
            }

            this._parentPopupStackControl = popupStackControl;
        }
Пример #5
0
        internal void InternalDiapose()
        {
            this.ParentHostStack    = null;
            this._isClosing         = false;
            this._isHostAtViewStack = false;
            this.ParentPopup        = null;

            if (this._dispatcherFrame != null)
            {
                this._dispatcherFrame.Continue = false;
            }

            this._dispatcherFrame = null;
            this._showingAsModal  = false;
        }
Пример #6
0
        internal void VerifyCanShow(PopupStackControl newpopupStackControl = null)
        {
            if (this._isClosing)
            {
                throw new Exception("该项当前不可显示,因为它当前正在关闭");
            }

            if (!this._isClosed)
            {
                throw new Exception("该项当前不可显示,因为它当前正在显示");
            }

            if (this._showingAsModal)
            {
                throw new Exception("该项当前不可显示,因为它当前正在以模态显示");
            }

            if (this.ParentHostStack != null &&
                !object.ReferenceEquals(this.ParentHostStack, newpopupStackControl))
            {
                throw new Exception("该项当前不可显示,因为它当前已处于某个视图堆栈中");
            }
        }
Пример #7
0
 public RichViewControl()
 {
     this._popupStackControl = new PopupStackControl();
 }
Пример #8
0
 public PopupItem()
 {
     this._childPopupStackControl = new PopupStackControl(this);
 }
Пример #9
0
 public PopupItem()
 {
     this._popupStackControl = new PopupStackControl();
 }