Пример #1
0
 /// <summary>
 /// Starts the dialog to edit an existing account
 /// </summary>
 /// <param name="parameter"></param>
 private void EditAccountFromCollection(object parameter)
 {
     if (parameter is TwoFACodeModel model)
     {
         PageDialogService.ShowAsync(new EditAccountContentDialog(model));
     }
 }
Пример #2
0
        /// <summary>
        /// Deletes an account from the collection
        /// </summary>
        /// <param name="parameter"></param>
        private async void DeleteAccountFromCollection(object parameter)
        {
            if (parameter is TwoFACodeModel model)
            {
                ContentDialog dialog = new ContentDialog();
                dialog.Title = Resources.DeleteAccountContentDialogTitle;
                var markdown = new MarkdownTextBlock
                {
                    Text = Resources.DeleteAccountContentDialogDescription
                };
                dialog.Content              = markdown;
                dialog.PrimaryButtonText    = Resources.Confirm;
                dialog.SecondaryButtonText  = Resources.ButtonTextCancel;
                dialog.SecondaryButtonStyle = App.Current.Resources["AccentButtonStyle"] as Style;
                ContentDialogResult result = await PageDialogService.ShowAsync(dialog);

                if (result == ContentDialogResult.Primary)
                {
                    TempDeletedTFAModel = model;
                    TwoFADataService.Collection.Remove(model);
                }
            }
        }