wpf - IValueConverter only being called when scrolling on DataGrid -
take @ following xaml snippet:
<datagridtextcolumn.cellstyle> <style targettype="{x:type datagridcell}"> <setter property="background" value="white"/> <setter property="borderthickness" value="0"/> <setter property="block.textalignment" value="center"/> <setter property="background"> <setter.value> <solidcolorbrush> <solidcolorbrush.color> <multibinding converter="{staticresource vapbrushconverter}"> <binding relativesource="{relativesource findancestor, ancestortype={x:type datagridcell}}"/> <binding relativesource="{relativesource findancestor, ancestortype={x:type usercontrol}}"/> </multibinding> </solidcolorbrush.color> </solidcolorbrush> </setter.value> </setter> </style> </datagridtextcolumn.cellstyle>
the ivalueconverter being called only when scroll on datagrid. inside datagridcell there textblock, , other time ivalueconverter being called when textblock.text property dependencyproperty.unsetvalue.
could tell me when ivalueconverter called, , if there can code resolve issue ? clarify - issue background being set ivalueconverter when scroll on datagrid.
i resolved issue setting binding current element in items source, this:
<binding path="."/> <binding relativesource="{relativesource findancestor, ancestortype={x:type usercontrol}}"/>
it looks problem ivalueconverter called when get/set accessors called. passing datagridcell in binding get/set when scrolling. contents of cell get/set whenever value changes, means ivalueconverter update accordingly.
Comments
Post a Comment