.net - How to apply a data template to a ListBox? -
i have listbox, when event occur outside listbox (ex click on button) need apply
categoriesunselecteddatatemplate
to element of categorieslistbox
anyidea how solve this?
<custom:surfacelistbox x:name="categorieslistbox" scrollviewer.horizontalscrollbarvisibility="disabled" scrollviewer.verticalscrollbarvisibility="hidden" manipulationdelta="categorieslistbox_manipulationdelta" ismanipulationenabled="true" selectionchanged="categorieslistbox_selectionchanged" itemtemplate="{dynamicresource categoriesunselecteddatatemplate}" verticalcontentalignment="stretch" horizontalcontentalignment="stretch" selectionmode="single" margin="115,131,-117,-49"> </custom:surfacelistbox> <datatemplate x:key="categoriesunselecteddatatemplate"> <grid> <grid.columndefinitions> <columndefinition width="auto"/> <columndefinition width="*"/> </grid.columndefinitions> <textblock name="titlecategory" textwrapping="wrap" text="{binding capitalizeddescription, fallbackvalue=categoryname}" foreground="#2fb8dc" fontfamily="/gateeclientwpf;component/fonts/#letter gothic l" horizontalalignment="left" verticalalignment="center" fontsize="30" margin="0,10"/> <image source="assets/common/right_grey.png" width="20" height="20" visibility="visible" horizontalalignment="left" verticalalignment="center" d:layoutoverrides="height" grid.column="1" margin="10,0,0,0"/> </grid> </datatemplate>
Comments
Post a Comment