private static void OnTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { TelegramRichTextBox source = (TelegramRichTextBox)d; string value = (string)e.NewValue; source.ParseText(value); }
private static void OnTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { TelegramRichTextBox source = (TelegramRichTextBox)d; string value = (string)e.NewValue; //if (value.Length <= 2) //{ // value += "TTT"; //} //System.Diagnostics.Debug.WriteLine("oldText={0} newText={1} foreground={2} textAlignment={3}", e.OldValue, e.NewValue, ((SolidColorBrush)source.Foreground).Color, source.TextAlignment); source.ParseText(value); }