private void CancelButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { #if DEBUG System.Diagnostics.Debug.WriteLine("CancelButton"); #endif Application.Current.Exit(); }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if(Windows.Storage.ApplicationData.Current.LocalSettings.Values.Any(m => m.Key.Equals("username"))) Windows.Storage.ApplicationData.Current.LocalSettings.Values.Remove("username"); Windows.Storage.ApplicationData.Current.LocalSettings.Values.Add(new KeyValuePair<string, object>("username", this.name.Text)); this.Username = this.name.Text; }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Dokument.statusBean = (Model.Status)statusi.SelectedItem; Dokument.vrstaDokumenta = (Model.VrstaDokumenta)vrsteDokumenata.SelectedItem; Dokument.kreiran = DateTime.Now; Dokument.istice = istice.Date.Date; }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // Disable the primary button IsPrimaryButtonEnabled = false; // Force the dialog to stay open until the operation completes. // We will call Hide() when the api calls are done. args.Cancel = true; try { // Change the passphrase await KryptPadApi.ChangePassphraseAsync(OldPassphrase, NewPassphrase); // Done await DialogHelper.ShowMessageDialogAsync("Profile passphrase changed successfully."); // Hide dialog Hide(); } catch (WarningException ex) { // Operation failed await DialogHelper.ShowMessageDialogAsync(ex.Message); } catch (WebException ex) { // Operation failed await DialogHelper.ShowMessageDialogAsync(ex.Message); } // Restore the button IsPrimaryButtonEnabled = CanChangePassphrase; }
private void ContentDialog_SecondaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args ) { if ( Member.WillLogin || Member.IsLoggedIn ) { args.Cancel = true; } }
private void DeleteItemClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (DeleteTodoItemClicked != null) { DeleteTodoItemClicked(this, (TodoItemViewModel)this.DataContext); } }
private async static void Tela_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { var tela = sender.Content as MyUserControl1; var readDataa = await ReadWrite.readStringFromLocalFile("data"); Profile profile = JsonSerilizer.ToProfile(readDataa); if (tela.passwordBoxSenha.Password == profile.Password) { } else { var acessar = new MyUserControl1(); ContentDialog dialogo = new ContentDialog(); dialogo.PrimaryButtonText = "Войти"; dialogo.PrimaryButtonClick += Tela_PrimaryButtonClick; dialogo.Content = acessar; await dialogo.ShowAsync(); } }
private void HandleContentDialogPrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if ((deleteSong.IsChecked.HasValue && deleteSong.IsChecked.Value) && (deleteSongConfirm.IsChecked.HasValue && deleteSongConfirm.IsChecked.Value)) { LibraryViewModel.Current.DeleteSong(Song); } else { Song.Name = editSongName.Text; Song.ArtistName = editArtistName.Text; string newAlbumName = editAlbumName.Text; string newAlbumAristName = editAlbumAritstName.Text; if (newAlbumName != Song.Album.Name || newAlbumAristName != Song.Album.ArtistName) { ArtistViewModel albumArtistViewModel = LibraryViewModel.Current.LookupArtistByName(newAlbumAristName); AlbumViewModel newAlbumViewModel = LibraryViewModel.Current.LookupAlbumByName(newAlbumName, albumArtistViewModel.ArtistId); Song.UpdateAlbum(newAlbumViewModel); } uint newTrackNumber; if (uint.TryParse(editTrackNumber.Text, out newTrackNumber)) { Song.TrackNumber = newTrackNumber; } } }
private void ContentDialog_PrimaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args ) { args.Cancel = true; DetectInputLogin(); Canceled = false; }
private void ContentDialog_PrimaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args ) { args.Cancel = true; if ( Keys.SelectedItem == null ) { StringResources stx = new StringResources(); ServerMessage.Text = "Please Select a key"; return; } string PubKey = RSA.SelectedItem.GenPublicKey(); string Remarks = RemarksInput.Text.Trim(); if ( string.IsNullOrEmpty( Remarks ) ) { Remarks = RemarksPlaceholder; } RCache.POST( Shared.ShRequest.Server , Shared.ShRequest.PlaceRequest( Target, PubKey, BindItem.Id, Remarks ) , PlaceSuccess , ( c, Id, ex ) => { Error( ex.Message ); } , false ); }
/// <summary> /// 确定 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { args.Cancel = true; UpLoading.Visibility = Visibility.Visible; IsPrimaryButtonEnabled = false; object[] result = await UserService.AddWZ(WZUrl.Text, WZTitle.Text, WZTags.Text, WZSummary.Text); if (result != null) { if ((bool)result[0]) { Hide(); } else { Tips.Text = result[1].ToString(); UpLoading.Visibility = Visibility.Collapsed; IsPrimaryButtonEnabled = true; } } else { Tips.Text = "操作失败!"; UpLoading.Visibility = Visibility.Collapsed; IsPrimaryButtonEnabled = true; } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { try { selection = int.Parse(number.Text); if (selection > 0 && selection <= MainPage.newestComic) canClose = true; else throw new OverflowException(); } catch (ArgumentNullException) { errorText.Text = "Please enter a number between 1 and " + MainPage.newestComic; canClose = false; } catch (FormatException) { errorText.Text = "Please enter a number between 1 and " + MainPage.newestComic; canClose = false; } catch (OverflowException) { errorText.Text = "Please enter a number between 1 and " + MainPage.newestComic; canClose = false; } }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // Ensure the user name and password fields aren't empty. If a required field // is empty, set args.Cancel = true to keep the dialog open. if (string.IsNullOrEmpty(txtUsername.Text)) { args.Cancel = true; txtError.Text = "User name is required"; return; } else if (string.IsNullOrEmpty(txtPassword.Password)) { args.Cancel = true; txtError.Text = "Password is required"; return; } // If you're performing async operations in the button click handler, // get a deferral before you await the operation. Then, complete the // deferral when the async operation is complete. ContentDialogButtonClickDeferral deferral = args.GetDeferral(); var rememberMe = chkRememberMe.IsChecked.Value; if( !await dataAccess.Login(txtUsername.Text, txtPassword.Password, rememberMe) ) { args.Cancel = true; txtError.Text = "Login Failed"; } deferral.Complete(); }
//Sign in button private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // Ensure the user name and password fields aren't empty. If a required field // is empty, set args.Cancel = true to keep the dialog open. if (string.IsNullOrEmpty(userNameTextBox.Text)) { args.Cancel = true; errorTextBlock.Text = "User name is required."; } else if (string.IsNullOrEmpty(passwordTextBox.Password)) { args.Cancel = true; errorTextBlock.Text = "Password is required."; } // If you're performing async operations in the button click handler, // get a deferral before you await the operation. Then, complete the // deferral when the async operation is complete. ContentDialogButtonClickDeferral deferral = args.GetDeferral(); //if (await SomeAsyncSignInOperation()) //{ this.Result = SignInResult.SignInOK; //} //else //{ // this.Result = SignInResult.SignInFail; //} deferral.Complete(); }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { var dataPackage = new DataPackage(); dataPackage.SetText(Result); Clipboard.SetContent(dataPackage); MessageHelper.ShowToastNotification("StoreLogo.png", "已复制到粘贴板!", NotificationAudioNames.Default); args.Cancel = true; }
private void ContentDialog_PrimaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args ) { args.Cancel = true; if ( Member.WillLogin || Member.IsLoggedIn ) return; DetectInputLogin(); Canceled = false; }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // If the user entered a passphrase, return it and hide the dialog if (!await ValidateInput()) { args.Cancel = true; } }
private async void Tela_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { this.Frame.Navigate( typeof(SettingsPage), new Windows.UI.Xaml.Media.Animation.DrillInNavigationTransitionInfo()); }
private async void ContentDialog_SaveEditButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { model.Akcija.naziv = naziv.Text; model.Akcija.id = Convert.ToInt32( id.Text); //model.Akcija.id = Convert.ToInt32(id.Text); await model.SaveEditAkcije(); //await model.SacuvajAkciju(); }
private static async void Rate_Click(ContentDialog sender, ContentDialogButtonClickEventArgs args) { //throw new NotImplementedException(); //if (ReadAppRatingSetting()) // return; //OpenStoreRating(); await Launcher.LaunchUriAsync(new Uri(string.Format("ms-windows-store:REVIEW?PFN={0}", Windows.ApplicationModel.Package.Current.Id.FamilyName))); }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { var selected = new List<object>(TileList.SelectedItems); var picker = new FileSavePicker(); picker.SuggestedFileName = $"export_{DateTime.Now.ToString(DateTimeFormatInfo.CurrentInfo.ShortDatePattern)}"; picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; picker.FileTypeChoices.Add("Tiles file", new List<string>() { ".tiles" }); var file = await picker.PickSaveFileAsync(); if (file != null) { CachedFileManager.DeferUpdates(file); await FileIO.WriteTextAsync(file, ""); using (var stream = await file.OpenStreamForWriteAsync()) using (var zip = new ZipArchive(stream, ZipArchiveMode.Update)) { while (zip.Entries.Count > 0) { zip.Entries[0].Delete(); } using (var metaStream = zip.CreateEntry("tiles.json").Open()) using (var writer = new StreamWriter(metaStream)) { var array = new JsonArray(); selected.ForEachWithIndex<SecondaryTile>((item, index) => { var objet = new JsonObject(); objet.Add("Name", item.DisplayName); objet.Add("Arguments", item.Arguments); objet.Add("TileId", item.TileId); objet.Add("IconNormal", item.VisualElements.ShowNameOnSquare150x150Logo); objet.Add("IconWide", item.VisualElements.ShowNameOnWide310x150Logo); objet.Add("IconBig", item.VisualElements.ShowNameOnSquare310x310Logo); array.Add(objet); if (item.VisualElements.Square150x150Logo.LocalPath != DEFAULT_URI) { var path = ApplicationData.Current.LocalFolder.Path + Uri.UnescapeDataString(item.VisualElements.Square150x150Logo.AbsolutePath.Substring(6)); zip.CreateEntryFromFile(path, item.TileId + "/normal"); } }); writer.WriteLine(array.Stringify()); } FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(file); if(status == FileUpdateStatus.Complete) { var folder = await file.GetParentAsync(); await new MessageDialog("Speichern erfolgreich").ShowAsync(); } else { await new MessageDialog("Speichern fehlgeschlagen").ShowAsync(); } Debug.WriteLine(status); } } }
private void SuccessButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs e ) { Email = EmailBox.Text; if ( string.IsNullOrWhiteSpace( Email ) ) { e.Cancel = true; } }
private async void AddRemainingUrl( ContentDialog sender, ContentDialogButtonClickEventArgs args ) { if ( TryAddUrl() ) { args.Cancel = true; await Task.Delay( 300 ); this.Hide(); } }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (currentMode == MODE_LOCAL) { var listGroupStr = tbox_group.Text; List<string> listGroupSplits = GroupDB.DistinctToList(GroupDB.TrimAll(listGroupStr)); if (listGroupSplits.Count() > GroupDB.MAX_GROUP) { var str = UC_AddressBook.ResourcesStringLoader.GetString("exceed_group_limit"); Modals.UIConfirmPopup.ShowAsyncInfoPopup(str); return; } List<int> listGroupId = GetListGroupId(listGroupSplits); if (listGroupId == null) { return; } var listContactId = listContact_EF.Select(ct => ct.Id).ToList(); var listAffectedGroupsID = dbController.GetAllGroupIdInGroupsContact(); var listAddGroupId = listGroupId.Where(g => listSharedGroupId.Contains(g) == false).ToList(); var listRemoveGroupId = listSharedGroupId.Where(g => listGroupId.Contains(g) == false).ToList(); await Task.Factory.StartNew(() => { var res = dbController.UpdateContactsOfGroups(listContactId, listRemoveGroupId,listAddGroupId); }); var isDeleteEmptyGroupSuccess = await Modals.UIConfirmTask.deleteListEmptyGroup(listAffectedGroupsID); if (parent is Page_LocalContacts) { var save_success = UC_AddressBook.ResourcesStringLoader.GetString("NOTIFY-Message-SaveSuccess"); Page_LocalContacts.SucceededMessage = save_success; ((Page_LocalContacts)parent).Reload(); } } else if (currentMode == MODE_PRINTER) { string stringGroupAdd = tbox_group.Text; stringGroupAdd = GroupDB.Distinct(GroupDB.TrimAll(stringGroupAdd)); List<string> listGroupSplits = GroupDB.ToList(stringGroupAdd); int count = listGroupSplits.Count(); if (count > GroupDB.MAX_GROUP) { var msg = UC_AddressBook.ResourcesStringLoader.GetString("exceed_group_limit"); Modals.UIConfirmPopup.ShowAsyncInfoPopup(msg); return; } List<string> listGroupAdd = new List<string> { stringGroupAdd }; ((Page_PrinterContacts)parent).UpdateGroupContact(listPrinterContact,listSharedGroupPrinter, listGroupAdd); ((Page_PrinterContacts)parent).UpdateListGroupName(); } }
/// <summary> /// 点击登录 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { args.Cancel = true; Logining.Visibility = Visibility.Visible; IsPrimaryButtonEnabled = false; string js = "document.getElementById('input1').setAttribute('value','" + UserName.Text + "');"; //用户名 js += "document.getElementById('input2').setAttribute('value','" + PassWord.Password + "');"; //密码 js += "document.getElementById('signin').click();"; //点击登录 Logining.Visibility = Visibility.Visible; await LogintWebView.InvokeScriptAsync("eval", new string[] { js }); bool login_fail = false; string login_result = ""; await Task.Run((Action)(async () => { while (true) { try { string js_login = "******"; await LogintWebView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => { login_result = await LogintWebView.InvokeScriptAsync("eval", new string[] { js_login}); } ); if (login_result.Contains("密码错误") || login_result.Contains("失败") || login_result.Contains("不存在")) { login_fail = true; break; } if (login_result.Contains("成功")) { break; } } catch { } } await LogintWebView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => { if (login_fail) { Tip.Text = login_result; IsPrimaryButtonEnabled = true; Logining.Visibility = Visibility.Collapsed; } }); })); }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { createProgress.IsActive = true; try { string matKhau = matKhauCuTextBox.Password; string matKhauMoi = matKhauMoiTextBox.Password; if (matKhauMoiTextBox.Password != nhapLaiMatKhauMoiTextBox.Password) { matKhauMoiTextBox.Focus(FocusState.Keyboard); throw new Exception("Mật khẩu xác nhận không trùng khớp.Vui lòng kiểm tra lại."); } bool isMatKhau = Regex.IsMatch(matKhau, "^[a-zA-Z][a-zA-Z0-9]{5,19}$", RegexOptions.IgnoreCase); // định dạng mật khẩu độ dài từ 6-20 ví dụ: gacon1908 if (matKhau.Length < 6) throw new Exception("Mật khẩu hiện tại quá ngắn. Tối thiểu 6 kí tự. Vui lòng kiểm tra lại."); if (!isMatKhau) { matKhauCuTextBox.Focus(FocusState.Keyboard); throw new Exception("Mật khẩu hiện tại không hợp lệ. Chỉ bao gồm kí tự latin và số.Vui lòng kiểm tra lại."); } bool isMatKhauMoi = Regex.IsMatch(matKhauMoi, "^[a-zA-Z][a-zA-Z0-9]{5,19}$", RegexOptions.IgnoreCase); // định dạng mật khẩu độ dài từ 6-20 ví dụ: gacon1908 if (matKhauMoi.Length < 6) throw new Exception("Mật khẩu mới quá ngắn. Tối thiểu 6 kí tự. Vui lòng kiểm tra lại."); if (!isMatKhauMoi) { matKhauMoiTextBox.Focus(FocusState.Keyboard); throw new Exception("Mật khẩu mới không hợp lệ. Chỉ bao gồm kí tự latin và số.Vui lòng kiểm tra lại."); } var result = await BUS.TaiKhoanNguoiDung.changMatKhau(matKhau, matKhauMoi); if (result) { textBlockError.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0)); textBlockError.Text = "Đổi mật khẩu thành công. Hãy thoát ra và đăng nhập lại để kiểm tra!"; textBlockError.UpdateLayout(); } else throw new Exception("Không đổi được mật khẩu. Mật khẩu cũ không chính xác. Vui lòng kiểm tra lại."); } catch (Exception ex) { textBlockError.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0)); textBlockError.Text = ex.Message; textBlockError.UpdateLayout(); } createProgress.IsActive = false; }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { switch (type) { case TYPE_CREATE: CreateFile(); break; case TYPE_RENAME: await RenameFile(); break; } }
/// <summary> /// 点击确定 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (SearchKey.Text.Equals("")) { SearchKey.Header = "请输入搜索关键字!"; args.Cancel = true; } else { KeyWords = SearchKey.Text; SearchType = ((bool)BlogRadioButton.IsChecked) ? 0 : 1; } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { string name = NameTextBox.Text; if (!CheckName(name)) { args.Cancel = true; return; } _node.Name = name; _callback(_node); }
private async void OkButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // Get the deferral because we need to await the // category creation. var deferral = args.GetDeferral(); // Get creation status and if failed, let's // keep the dialog opened. var success = await ViewModel.CreateCategory(); args.Cancel = !success; // Complete deferral to close the dialog. deferral.Complete(); }
private void ContinueButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Hide(); _navigationService.ShowDialog(NavigationDialog.ImportSecretPhrase); }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { CategoryViewModel.update(); }
private void X_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { btn_SaveImage_Click(sender, null); }
private void OnClickAnnulerDlg(ContentDialog sender, ContentDialogButtonClickEventArgs args) { sender.Hide(); }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { //Ignore }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { canceled = false; Hide(); }
private void InsertHyperlink_Click(ContentDialog sender, ContentDialogButtonClickEventArgs args) { WikiLink = (string)WikiLinkComboBox.SelectionBoxItem; }
private void Dialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { WriteCallerName(); args.Cancel = true; this.InvertTheme(); }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs e) { }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Client = null; }
private void Dialog_CloseButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { WriteCallerName(); }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { }
private void Dialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { ApiHelper.logout(); }
private void CancelButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Hide(); }
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ #region --Set-, Get- Methods-- #endregion //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ #region --Misc Methods (Public)-- #endregion #region --Misc Methods (Private)-- #endregion #region --Misc Methods (Protected)-- #endregion //--------------------------------------------------------Events:---------------------------------------------------------------------\\ #region --Events-- private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { VIEW_MODEL.Confirm(); }
private async void PermissionDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-broadfilesystemaccess")); }
private void NameDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { inputForRename = inputFromRename.Text; }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Text = ""; }
private void ContentDialog_CloseButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // User clicked Cancel, ESC, or the system back button. this.Result = CreateResult.SignInCancel; }
private void DenyButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Allow = false; }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { this.ClearForm(); args.Cancel = true; }
private void AllowButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Allow = true; }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { this.Hide(); }
private async void QueueContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { ContentDialogButtonClickDeferral Deferral = args.GetDeferral(); try { if (CurrentUseProgramList.SelectedItem is ProgramPickerItem CurrentItem) { SelectedProgram = CurrentItem; } else if (OtherProgramList.SelectedItem is ProgramPickerItem OtherItem) { SelectedProgram = OtherItem; } else { args.Cancel = true; } if (SelectedProgram != null && UseAsAdmin.IsChecked.GetValueOrDefault() || OpenFromPropertiesWindow) { await SQLite.Current.SetDefaultProgramPickerRecordAsync(OpenFile.Type, SelectedProgram.Path); } } catch (Exception ex) { LogTracer.Log(ex); } finally { Deferral.Complete(); } }
private void ConDlg_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { MediaPlayer.Source = MediaSource.CreateFromUri(new Uri(txtbox.Text)); }
private void NameDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { storedRenameInput = inputBox.Text; }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { ConnectSelected = false; }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { VIEW_MODEL.Cancel(); }
private void ContentDialog_OKButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (string.IsNullOrEmpty(NameText.Text) || string.IsNullOrEmpty(AddressText.Text) || OnlyNumbers(NameText.Text)) { var dialog = new MessageDialog("Ej giltig inmatning"); var t = dialog.ShowAsync().GetAwaiter(); } else { if (StoreCustomerRadioButton.IsChecked == true) { if (!OnlyNumbers(NameText.Text) && !OnlyNumbers(AddressText.Text)) { if (string.IsNullOrEmpty(PhonenumberText.Text)) { CustomerManager.AddNewUser(NameText.Text, AddressText.Text, CustomerType.Butikskund); } else if (OnlyNumbers(PhonenumberText.Text)) { CustomerManager.AddNewUser(NameText.Text, AddressText.Text, CustomerType.Butikskund, phonenumber: PhonenumberText.Text); } else { var dialog = new MessageDialog("Du har fyllt telefonnummer med fel format"); var t = dialog.ShowAsync().GetAwaiter(); } } else { var dialog = new MessageDialog("Du har fyllt rutorna med fel format"); var t = dialog.ShowAsync().GetAwaiter(); } } else if (OnlineCustomerRadioButton.IsChecked == true) { if (string.IsNullOrEmpty(CreditCardText.Text) || string.IsNullOrEmpty(DeliveryAddressText.Text)) { var dialog = new MessageDialog("Du har inte fyllt i alla obligatoriska rutor"); var t = dialog.ShowAsync().GetAwaiter(); } else if (OnlyNumbers(CreditCardText.Text) && !OnlyNumbers(DeliveryAddressText.Text) && !OnlyNumbers(NameText.Text) && !OnlyNumbers(AddressText.Text)) { if (string.IsNullOrEmpty(PhonenumberText.Text)) { CustomerManager.AddNewUser(NameText.Text, AddressText.Text, CustomerType.Onlinekund, deliveryAddress: DeliveryAddressText.Text, creditCardNumber: CreditCardText.Text, customerEmail: CustomerEmailText.Text); } else if (OnlyNumbers(PhonenumberText.Text)) { CustomerManager.AddNewUser(NameText.Text, AddressText.Text, CustomerType.Onlinekund, deliveryAddress: DeliveryAddressText.Text, creditCardNumber: CreditCardText.Text, customerEmail: CustomerEmailText.Text, phonenumber: PhonenumberText.Text); } else { var dialog = new MessageDialog("Du har fyllt telefonnummer med fel format"); var t = dialog.ShowAsync().GetAwaiter(); } } else { var dialog = new MessageDialog("Du har fyllt rutorna med fel format"); var t = dialog.ShowAsync().GetAwaiter(); } } else { var anotherDialog = new MessageDialog("Du har inte valt kundtyp"); var y = anotherDialog.ShowAsync().GetAwaiter(); } } }
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { MadeChanges = false; }