private void ProcessSecondaryButton() { void Complete(ContentDialogButtonClickEventArgs a) { if (!a.Cancel) { const ContentDialogResult result = ContentDialogResult.Secondary; SecondaryButtonCommand.ExecuteIfPossible(SecondaryButtonCommandParameter); Hide(result); } else { _hiding = false; } } if (_hiding) { return; } _hiding = true; var args = new ContentDialogButtonClickEventArgs(Complete); SecondaryButtonClick?.Invoke(this, args); if (args.Deferral == null) { Complete(args); } }
private void SecondaryButton_Click(object sender, RoutedEventArgs e) { SecondaryButtonCommand?.Execute(SecondaryButtonCommandParameter); SecondaryButtonClick?.DynamicInvoke(); Result = CustomContentDialogResult.Secondary; Hide(); }
private void SecondaryButtonRoutedExecuted(object sender, ExecutedRoutedEventArgs e) { LightContentDialogButtonClickEventArgs lightContentDialogButtonClickEventArgs = new LightContentDialogButtonClickEventArgs(); SecondaryButtonClick?.Invoke(this, lightContentDialogButtonClickEventArgs); if (!lightContentDialogButtonClickEventArgs.Cancel) { SecondaryButtonCommand?.Execute(SecondaryButtonCommandParameter); tcs.TrySetResult(LightContentDialogResult.Secondary); } }
private void ProcessSecondaryButton() { void Complete(ContentDialogButtonClickEventArgs a) { if (!a.Cancel) { _tcs.SetResult(ContentDialogResult.Secondary); SecondaryButtonCommand.ExecuteIfPossible(SecondaryButtonCommandParameter); Hide(); } } var args = new ContentDialogButtonClickEventArgs(Complete); SecondaryButtonClick?.Invoke(this, args); if (args.Deferral == null) { Complete(args); } }