Пример #1
0
        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);
            }
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
        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;
            }
        }
Пример #4
0
 public Command_EnterKeyDefault(TBoxLabel tbl)
 {
     this._TBL = tbl;
 }