private void CloseDrawerHandler(object sender, ExecutedRoutedEventArgs executedRoutedEventArgs) { if (executedRoutedEventArgs.Handled) { return; } if (executedRoutedEventArgs.Parameter is Dock dock) { var drawerClosingEventArgs = new DrawerClosingEventArgs(dock, DrawerClosingEvent); //multiple ways of calling back that the drawer is closing: // * routed event OnDrawerClosing(drawerClosingEventArgs); if (drawerClosingEventArgs.IsCancelled) { return; } } SetOpenFlag(executedRoutedEventArgs, false); executedRoutedEventArgs.Handled = true; }
protected void OnDrawerClosing(DrawerClosingEventArgs eventArgs) { RaiseEvent(eventArgs); }