private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { // make sure quantity is in correct format if (TextBoxRegex.GetIsValid(TextBoxQuantity) == false) { FlyoutWarmingText.Text = "Wrong numerical value!"; FlyoutWarming.ShowAt(TextBoxQuantity); args.Cancel = true; return; } if (TextBoxRegex.GetIsValid(TextBoxCost) == false) { FlyoutWarmingText.Text = "Wrong numerical value!"; FlyoutWarming.ShowAt(TextBoxCost); args.Cancel = true; return; } // perform real update TextBoxQuantity.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TextBoxCost.GetBindingExpression(TextBox.TextProperty).UpdateSource(); DatePickerPurchaseDate.GetBindingExpression(DatePicker.DateProperty).UpdateSource(); ComboBoxProvider.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); }
private void ClearControls() { TextBoxCode.Clear(); TextBoxName.Clear(); TextBoxCost.Clear(); ComboBoxCategory.ResetText(); }
/// <summary> /// Очищает текстовые поля /// </summary> private void ClearData() { TextBoxNumber.Clear(); TextBoxCrew1.Clear(); TextBoxCrew2.Clear(); TextBoxCost.Clear(); }
// Private Functions // ----------------- private void SetMovieSelection(bool clear) { // set/disable next button ButtonNext.Enabled = !clear; if (clear) { PictureBoxMovie.BackgroundImage = null; TextBoxTitle.Clear(); TextBoxCategory.Clear(); TextBoxCost.Clear(); // confirm selectedMovie is null if we're clearing selectedMovie = null; Program.MovieSelection = null; } else { PictureBoxMovie.BackgroundImage = selectedMovie.Poster; TextBoxTitle.Text = selectedMovie.Title; TextBoxCategory.Text = selectedMovie.Genre; TextBoxCost.Text = "$ " + selectedMovie.Price.ToString(); Program.MovieSelection = selectedMovie; } }