SetTextLength() private static method

private static SetTextLength ( DependencyObject obj, int value ) : void
obj System.Windows.DependencyObject
value int
return void
Exemplo n.º 1
0
 private static void OnNumericUpDownValueChaged(object sender, RoutedEventArgs e)
 {
     TextBoxHelper.SetTextLength <NumericUpDown>(sender as NumericUpDown, (NumericUpDown numericUpDown) => {
         if (!numericUpDown.Value.HasValue)
         {
             return(0);
         }
         return(1);
     });
 }
Exemplo n.º 2
0
 private static void TextChanged(object sender, RoutedEventArgs e)
 {
     TextBoxHelper.SetTextLength <TextBox>(sender as TextBox, (TextBox textBox) => textBox.Text.Length);
 }
Exemplo n.º 3
0
 private static void PasswordChanged(object sender, RoutedEventArgs e)
 {
     TextBoxHelper.SetTextLength <PasswordBox>(sender as PasswordBox, (PasswordBox passwordBox) => passwordBox.Password.Length);
 }