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; }
public PopupStack(PopupStackControl popupStackControl) { if (popupStackControl == null) { throw new ArgumentNullException(nameof(popupStackControl)); } this._parentPopupStackControl = popupStackControl; }
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; }
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("该项当前不可显示,因为它当前已处于某个视图堆栈中"); } }
public RichViewControl() { this._popupStackControl = new PopupStackControl(); }
public PopupItem() { this._childPopupStackControl = new PopupStackControl(this); }
public PopupItem() { this._popupStackControl = new PopupStackControl(); }