Exemple #1
0
        private void Close_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            CloseCanExecuteEventArgs canExec = new CloseCanExecuteEventArgs();

            CanClose?.Invoke(this, canExec);
            e.CanExecute = canExec.CanExecute;
        }
Exemple #2
0
 public void ConfirmEdit()
 {
     if (Service.UpdateGadget(EditGadget))
     {
         MessageBox.Show("Update was Successful");
         CanClose?.Invoke(this, new EventArgs());
     }
 }
Exemple #3
0
 public void Save()
 {
     if (!Service.AddGadget(Gadget))
     {
         MessageBox.Show("Error while adding your new gadget");
     }
     else
     {
         CanClose?.Invoke(this, new EventArgs());
     }
 }
Exemple #4
0
 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());
 }
Exemple #5
0
 public async Task CloseModal()
 {
     if (CanClose.Invoke())
     {
         _showAnimateAway = true;
         _showAnimateUp   = false;
         StateHasChanged();
         await Task.Run(() =>
         {
             Thread.Sleep(300);
             _isOpen          = false;
             _showAnimateAway = false;
             InvokeAsync(StateHasChanged);
         });
     }
 }
Exemple #6
0
 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);
 }
Exemple #9
0
 public void CancelDeleteGadget()
 {
     CanClose?.Invoke(this, new EventArgs());
 }