Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Comment on "RichTextBox"

$
0
0
Binding doesn't work when Mode=OneWay. Example: Xaml: <extToolkit:RichTextBox IsReadOnly="True" Text="{Binding MyText, Mode=OneWay}"> <extToolkit:RichTextBox.TextFormatter> <extToolkit:PlainTextFormatter /> </extToolkit:RichTextBox.TextFormatter> </extToolkit:RichTextBox> ViewModel: public string MyText { get; private set; } this.MyTextChangeCommand = new RelayCommand(() => { this.MyText = "new value"; this.RaisePropertyChanged(nameof(this.MyText)); }}); But the same code perfectly works if replace RichTextBox to TextBox. And also works after the following correction: Xaml: <extToolkit:RichTextBox IsReadOnly="True" Text="{Binding MyText}"> <extToolkit:RichTextBox.TextFormatter> <extToolkit:PlainTextFormatter /> </extToolkit:RichTextBox.TextFormatter> </extToolkit:RichTextBox> ViewModel: public string MyText { get; set; } this.MyTextChangeCommand = new RelayCommand(() => { this.MyText = "new value"; this.RaisePropertyChanged(nameof(this.MyText)); }});

Viewing all articles
Browse latest Browse all 4964

Trending Articles