private static void OnTBWidthChange(DependencyObject d, DependencyPropertyChangedEventArgs e) { TBoxLabel control = d as TBoxLabel; double n = (double)e.NewValue; if (n != double.NaN) { control.BaseTBox.Width = (n < control.BaseLabel.Width ? control.BaseLabel.Width : n); } }
private static void OnEnterKeyBindingChange(DependencyObject d, DependencyPropertyChangedEventArgs e) { TBoxLabel control = d as TBoxLabel; if (e.NewValue == null) { control.EnterKeyBinding = new Command_EnterKeyDefault(control); } else if (e.NewValue != control.EnterKeyBinding) { control.EnterKeyBinding = (ICommand)e.NewValue; } }
private static void OnReadOnlyChange(DependencyObject d, DependencyPropertyChangedEventArgs e) { TBoxLabel control = d as TBoxLabel; if ((bool)e.NewValue == true) { control.BaseTBox.Background = (Brush)Application.Current.Resources["BackgroundAppColor"]; } else if ((bool)e.NewValue == false) { control.BaseTBox.Background = Brushes.White; } }
public Command_EnterKeyDefault(TBoxLabel tbl) { this._TBL = tbl; }