private async void Button_Click_3(object sender, RoutedEventArgs e) { ConfirmBTN.Content = new LoadingCtrl() { ContentString = "Processing" }; var spicker = new FileSavePicker(); spicker.FileTypeChoices.Add("XML", new List <String>() { ".xml" }); var sfs = await spicker.PickSaveFileAsync(); if (sfs == null) { TB_Password.Password = ""; export_flyout.Hide(); return; } await DataPacManager.SerializeAsync(sfs, TB_Password.Password); if ((bool)Export_cb.IsChecked) { Core.Current.DeleteUser(); Core.Current.Unsubscribe(); Frame.Navigate(typeof(MainPage)); } }
private async void ConfirmBTN_Click(object sender, RoutedEventArgs e) { ConfirmBTN.Content = new LoadingCtrl(); try { await DataPacManager.DeserializeAsync(sf, TB_Password.Password); Frame.Navigate(typeof(MainPage)); } catch (DataPacManager.KeyVertifyFailException) { TB_Password.BorderBrush = new SolidColorBrush(new Windows.UI.Color() { A = 255, R = 255, B = 0, G = 0 }); TB_Password.Header = new TextBlock() { Text = "Password error", Foreground = new SolidColorBrush(new Windows.UI.Color() { A = 255, R = 255, B = 0, G = 0 }) }; ConfirmBTN.Content = "Submit"; } }