I’m developing a plugin interface and I would like to have one method that returns formatted text in a way that a WPF control can just show the plugin result. What would be the best way to return that text?
This way I will only need to assign the plugin result to a WPF text control (maybe a RichTextBox or something like that).
I would like to support bold, underline, etc …
EDIT: Summarizing, I’m searching from a string “format” that allow 3rd party coders to return me a simple string with encoded format so I just need to do:
myRichTextBox.Text = (IPlugin)3rdPartyPlugin.ExecutePlugin();
And the text appears formatted.
There are various Code behind ways to return a formatted text…
1] As Text
WPF Flowdocument and Inlines
2] As a graphically rendered text …
In any custom control’s overriden OnRender() method you can graphically paint the formatted text as a drawing …