/// <param name="argument"></param> /// <inheritdoc /> protected override async Task <bool> ShouldCancelAsync(IWindowClosingBehaviorContext argument) { var dialogService = argument.ServiceProvider.GetRequiredService <IDialogService>(); if (await dialogService.YesNoAsync(argument.ViewModel, $"Should the window of type {argument.ViewModel.ToString()} be closed?")) { return(false); } return(true); }
/// <inheritdoc /> protected override async Task <bool> ShouldCancelAsync(IWindowClosingBehaviorContext argument) { return(!await Callback(argument)); }