private void Type_SelectionChanged(object sender, SelectionChangedEventArgs e) { var scope = InputScopeNameValue.NumericPin; var maxLength = 4; switch (Type.SelectedIndex) { case 1: scope = InputScopeNameValue.Password; maxLength = int.MaxValue; break; } First.Password = Confirm.Password = string.Empty; First.MaxLength = Confirm.MaxLength = maxLength; var firstScope = new InputScope(); firstScope.Names.Add(new InputScopeName(scope)); First.InputScope = firstScope; var confirmScope = new InputScope(); confirmScope.Names.Add(new InputScopeName(scope)); Confirm.InputScope = confirmScope; First.Focus(FocusState.Keyboard); }
private void Btn_Click(object sender, RoutedEventArgs e) { First.Focus(); foreach (FrameworkElement item in pnl.Children) { if (item is NumericUpDown) { NumericUpDown nud = item as NumericUpDown; nud.GetBindingExpression(NumericUpDown.ValueProperty).UpdateSource(); } } }
private void Btn_Click(object sender, RoutedEventArgs e) { First.Focus(); foreach (FrameworkElement item in pnl.Children) { if (item is TextBox) { TextBox txt = item as TextBox; txt.GetBindingExpression(TextBox.TextProperty).UpdateSource(); } } }