Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }