I comprehend MVVM with MVVM Light and I have a problem with the RichTextBox. I zabindil its Text property and it turns out to change it from ViewModel, but when I need to access the rows that the user typed in the RichTextBox in ViewModel, I constantly get null. How to fix it? I don’t know if it matters, but just in case I’ll clarify that I still use MahApps.Metro.
<RichTextBox x:Name="RichTextBoxOther" HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"> <FlowDocument PageWidth="1000"> <Paragraph> <Run Text="{Binding RichTextBoxOther_Text, Mode=TwoWay}" /> </Paragraph> </FlowDocument> </RichTextBox> private string _richTextBoxOther_Text; public string RichTextBoxOther_Text { get { return _richTextBoxOther_Text; } set { _richTextBoxOther_Text = value; RaisePropertyChanged(() => RichTextBoxOther_Text); } }