SetTextLength() приватный статический Метод

private static SetTextLength ( DependencyObject obj, int value ) : void
obj System.Windows.DependencyObject
value int
Результат void
Пример #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);
     });
 }
Пример #2
0
 private static void TextChanged(object sender, RoutedEventArgs e)
 {
     TextBoxHelper.SetTextLength <TextBox>(sender as TextBox, (TextBox textBox) => textBox.Text.Length);
 }
Пример #3
0
 private static void PasswordChanged(object sender, RoutedEventArgs e)
 {
     TextBoxHelper.SetTextLength <PasswordBox>(sender as PasswordBox, (PasswordBox passwordBox) => passwordBox.Password.Length);
 }