We would like to create a text editor for our clients in our software.
We would like to have a simple options like:
- Bold
- Underline
- Italic
- Hyperlink
Then I would like this message to be saved in db as XAML and then just bind the XAML string to my Content Control.
The XAML can be as follows:
<TextBlock>
<TextBlock.Text>
<Hyperlink NavigateUri="http://somesite.com"/>
Click here to go to somesite.com
</TextBlock.Text>
</TextBlock>
Is there any free editor for this purspose?
How can I parse the string to be saved in appropriate, correct XAML?
In order to parse the XAML, use the XamlReader class. The load method is overloaded to give you several options on parsing XAML.
There are several projects that you can look at if you don’t want to reinvent the wheel (although the XamlReader is quite powerful).