protected virtual void OnIsPaneOpenChanged() { var cancel = false; if (this.PaneClosing != null) { var args = new SplitViewPaneClosingEventArgs(); foreach (var paneClosingDelegates in this.PaneClosing.GetInvocationList()) { var eventHandler = paneClosingDelegates as EventHandler <SplitViewPaneClosingEventArgs>; if (eventHandler == null) { continue; } eventHandler(this, args); if (args.Cancel) { cancel = true; break; } } } if (!cancel) { this.ChangeVisualState(); this.PaneClosed?.Invoke(this, EventArgs.Empty); } else { this.IsPaneOpen = false; } }
private void Splitview_PaneClosing(object sender, SplitViewPaneClosingEventArgs e) { var splitView = sender as SplitView; if (splitView == null) return; e.Cancel = (bool)splitView.Tag; }
protected virtual void OnIsPaneOpenChanged() { var cancel = false; if (this.PaneClosing != null) { var args = new SplitViewPaneClosingEventArgs(); foreach (var paneClosingDelegates in this.PaneClosing.GetInvocationList()) { var eventHandler = paneClosingDelegates as EventHandler<SplitViewPaneClosingEventArgs>; if (eventHandler == null) continue; eventHandler(this, args); if (args.Cancel) { cancel = true; break; } } } if (!cancel) { this.ChangeVisualState(); this.PaneClosed?.Invoke(this, EventArgs.Empty); } else { this.IsPaneOpen = false; } }