I have a TextBox control:
<TextBox Text={Binding MyText},.../>
where
MyText = "leftWord/rightWord";
I understand that to get multiple foreground colors I cannot use a TextBox but rather a TextBlock or RichTextBox. Since I need to edit the text, I will use a RichTextBox.
My goal is to highlight (change the foreground color) either "leftWord" or "rightWord" in the displayed text depending on the value of another property, such as
MyChoice = Left|Right
I am not sure how I can set the Run content to the right characters based on the MyChoice property. Is there a way I can pass the entire text to a converter, along with the value of MyChoice and somehow have that set the correct foreground colors? If so, I am not sure what the xaml would look like.
Would this be possible with a RichTextBox? I notice it has no Text property so I am not even sure how to bind (two-way binding) MyText to it.