wpf - Property element and attribute tag syntax -


i have simple label element , code in 2 ways.

approach 1: use attribute syntax converter attribute of binding markup extension. converter attribute in curly braces {}.

<label text="flag background" backgroundcolor="{binding source={x:reference switch3}, path=istoggled, converter={staticresource booltocolor}}"></label> 

approach 2: use property-element tag converter attribute; ok.

<label>     <label.text>       <binding source="{x:reference switch3}" path="istoggled">         <binding.converter>           <toolkit:booltostringconverter falsetext="red" truetext="lime"></toolkit:booltostringconverter>         </binding.converter>       </binding>     </label.text>    </label> 

however, cannot make source property-element tag. not understand why cannot use property-element tag source. please explain.

<label>     <label.text>       <binding.source>           ...       </binding.source>     </label.text>    </label> 

you can, forgot binding itself:

<label>     <label.text>         <binding>             <binding.source>...</binding.source>         </binding>     </label.text> </label> 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -