protected override async Task ExecuteAsync(IKey key, CancellationToken cancellationToken) { Movie model = collection.FindByKey(key); if (model != null && await navigator.ConfirmAsync($"Delete movie '{model.Name}'?")) { changeTracker.Remove(collection, model); } }
private async void OnClosing(object sender, CancelEventArgs e) { if (isConfirmed) { isConfirmed = false; return; } if (ViewModel.HasChange) { e.Cancel = true; if (await navigator.ConfirmAsync("You have unsaved changes. Do you want to save them now?")) { ViewModel.Save.Execute(null); } isConfirmed = true; Close(); } }