How to avoid comma when using markup extension?

The value of the second markup extension parameter that I use is a string containing some commas, and I do not want these commas to be interpreted as parameter separators by the xaml interpreter / parser, but that the entire string as such including commas is used as a value.

Here is an example:

<SomeControl SomeProperty="{Wpf:MyExtension MyFirstParameter, MySecondParameter, being a string, containing some commas.}" /> 

Google did not help, I found some similar problems, but no one applies to this problem:

+7
source share
1 answer

You can use single quotes to encapsulate a string; so your premium should look something like this:

 <SomeControl SomeProperty="{Wpf:MyExtension MyFirstParameter, 'MySecondParameter, being a string, containing some commas.'}" /> 

I'm not sure you will also need the escape sequence markup {} .

+14
source

All Articles