private void Close_CanExecute(object sender, CanExecuteRoutedEventArgs e) { CloseCanExecuteEventArgs canExec = new CloseCanExecuteEventArgs(); CanClose?.Invoke(this, canExec); e.CanExecute = canExec.CanExecute; }
public void ConfirmEdit() { if (Service.UpdateGadget(EditGadget)) { MessageBox.Show("Update was Successful"); CanClose?.Invoke(this, new EventArgs()); } }
public void Save() { if (!Service.AddGadget(Gadget)) { MessageBox.Show("Error while adding your new gadget"); } else { CanClose?.Invoke(this, new EventArgs()); } }
public void ConfirmDeleteGadget() { if (!Service.DeleteGadget(Gadget)) { MessageBox.Show("Error while deleting the Gadget. Please try later"); } else { MessageBox.Show("Deleted Successfully"); } CanClose?.Invoke(this, new EventArgs()); }
public async Task CloseModal() { if (CanClose.Invoke()) { _showAnimateAway = true; _showAnimateUp = false; StateHasChanged(); await Task.Run(() => { Thread.Sleep(300); _isOpen = false; _showAnimateAway = false; InvokeAsync(StateHasChanged); }); } }
public void CancelEdit() { CanClose?.Invoke(this, new EventArgs()); }
private void CloseButton_Tapped(object sender, TappedRoutedEventArgs e) { CanClose?.Invoke(this, EventArgs.Empty); }
private void SaveButton_Tapped(object sender, TappedRoutedEventArgs e) { Player.Save(); CanClose?.Invoke(this, EventArgs.Empty); PlayerSaved?.Invoke(this, Player); }
public void CancelDeleteGadget() { CanClose?.Invoke(this, new EventArgs()); }