c# - How to toggle image based on BooleanToVisibilityConverter? -
in wpf datagrid, have datagridtemplatecolumn:
<datagridtemplatecolumn> <datagridtemplatecolumn.celltemplate> <datatemplate> <image visibility="{binding showimage, mode=oneway, convert{staticresource booleantovisibilityconverter}}" source="{staticresource image1}" /> </datatemplate> </datagridtemplatecolumn.celltemplate> </datagridtemplatecolumn>
this column starts no image. processing occurs. if showimage assigned true, image displayed. else, nothing displayed.
how toggle between 2 images based on assignment showimage?
just use converter (maybe can call booltoimagecoverter) assign 1 image if showimage true , different image if showimage false.
Comments
Post a Comment