Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to handle type in WPF text

$
0
0

Dear all,

I have a configuration file for my application where I am reading some text to be displayed in user interface. one request is to be able to format part of initial text as bold.

For exemple I have the following XML config file snipet:

<Paragraphs><Paragraph><Header>Features</Header><Description>
                This is a sample text that need to be displayed.</Description></Paragraph></Paragraphs>

Based on theis XML file I am reading text descritpion and store it in a MVVM model.
Then in some case, my cutsomer has a need to set in bold part of that text but I do not know in advance which one.

So the best would be that I could define in teh XML file which text part needs to be in bold and then beeing automatically render as is. I was thinking of writing my description text as follow :

<Description>
                This is a <b>sample</b> text that need to be displayed.</Description>

Then text will be render as :

This is a sample text that need to be displayed.

What is the best way to handle such case in WPF ? Is there a particular control like that could handle this ?

Thnaks for help

regards


Your knowledge is enhanced by that of others.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>