I am using a WPF application using the MUI (Modern User Interface) libraries by FirstFloor. I would like to have the option to have an update page where the user is allowed to type in a message or what have you and what they type in the RichTextBox
will then be updated on the Home.xaml TextBlock.Text
. I have no idea how to start this. Can anyone help out?

- 30,841
- 27
- 92
- 100

- 661
- 10
- 24
1 Answers
As stated, the question is fairly broad. It would be better if you would provide a good, minimal, complete code example that shows clearly what you've tried so far, along with a detailed explanation of what that code does and how it's different from what you want.
Barring that…
The most obvious answer seems to me to be: store the text in a string
property somewhere, which is bound to both the RichTextBox
(e.g. to the Document
property via converter) and the TextBlock.Text
property.
Assuming the text should be updated only via the RichTextBox
, you can bind using OneWayToSource
, and likewise to the TextBlock.Text
property as OneWay
. I.e. set up the bindings so that they properly reflect the intended flow of information. Make sure to select the appropriate UpdateSourceTrigger
value for your scenario (e.g. LostFocus
or PropertyChanged
) so that the bound property value is updated according to your needs.
In this way, when the user edits the RichTextBox
, the backing property will be updated to reflect the user's input, and then will be automatically mirrored to the TextBox
as desired.

- 68,759
- 7
- 102
- 136
-
Honestly I haven't tried anything as I have no idea where to start. – William Hodges Sep 12 '15 at 05:47
-
Then I would suggest starting as I describe above. Once you have some actual code, it will be possible to ask a better, more specific question (or you will just get it working on your own). – Peter Duniho Sep 12 '15 at 06:00
-
I'll do a little digging to fully understand your answer. I'm self teaching C# and XAML so I don't quit know everything yet lol – William Hodges Sep 12 '15 at 06:43
-
Understood. Unfortunately, to provide from scratch all of the foundational information implied in the above, such as how to correctly set up dependency properties and bind them to UI element properties, would make your question far too broad. It's assumed that you've got some familiarity with the API already. – Peter Duniho Sep 12 '15 at 08:26