private void ClosePane() { SplitViewPaneClosingEventArgs args = new SplitViewPaneClosingEventArgs(); PaneClosing?.Invoke(this, args); if (args.Cancel) { if (DisplayMode == SplitViewDisplayMode.Overlay || DisplayMode == SplitViewDisplayMode.CompactOverlay) { IsPaneOpen = true; return; } } ChangeVisualState(true); PaneClosed?.Invoke(this, EventArgs.Empty); }
protected virtual void OnIsPaneOpenChanged() { bool cancel = false; if (PaneClosing != null) { var args = new SplitViewPaneClosingEventArgs(); foreach (EventHandler<SplitViewPaneClosingEventArgs> tmp in PaneClosing.GetInvocationList()) { tmp(this, args); if (args.Cancel) { cancel = true; break; } } } if (!cancel) { ChangeVisualState(); if (PaneClosed != null) { PaneClosed(this, EventArgs.Empty); } } else { IsPaneOpen = false; } }
private void splitview_PaneClosing(object sender, SplitViewPaneClosingEventArgs e) { e.Cancel = cancelClose.IsChecked.Value; }