c# - XAML - Change icon dependent on binding -


i'm creating listview , binding data, working ok, can't work out how change icon based on data value.

<border background="aquamarine" grid.column="0">         <symbolicon symbol="folder" horizontalalignment="center" margin="10"/> </border> <border background="yellow" grid.column="1">        <textblock text="{binding fname}" margin="5" /> </border> 

so symbolicon folder how change icon if underlying data set has boolean value denoting folder false?

in fact there way of changing other styling in following textblock, based on actual data underlying field?

you can change symbol based on bool property binding using ivalueconverter. have ivalueconverter convert true "folder" , false "somethingelse" (whatever icon want false).

the binding like:

<symbolicon symbol="{binding path=thebooleanproperty, converter=nameoftheivalueconverterresource" horizontalalignment="center" margin="10"/> 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -