// called when max-length property is changed private static void MaxLengthPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { int value = (int)e.NewValue; MultilineTextEditor control = sender as MultilineTextEditor; if (control == null || control.textBox == null) { return; } // set the popup text box max length control.textBox.MaxLength = value; }
// called when read-only property is changed private static void IsReadOnlyPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { bool value = (bool)e.NewValue; MultilineTextEditor control = sender as MultilineTextEditor; if (control == null || control.textBox == null) { return; } // set the popup text box as readonly true/false control.textBox.IsReadOnly = value; }