i have problem listview , have no idea how solve without hardcoding width:
i have listview:
<listview name="lststates" commonnavigationtransitioninfo.isstaggerelement="true" continuumnavigationtransitioninfo.exitelementcontainer="true" isitemclickenabled="true" itemclick="lststates_itemclick" itemssource="{binding states}" horizontalalignment="stretch" > <listview.itemtemplate> <datatemplate> <grid margin="8" background="aliceblue" horizontalalignment="stretch"> <grid.columndefinitions> <columndefinition width="1*" /> <columndefinition width="auto" /> </grid.columndefinitions> <textblock commonnavigationtransitioninfo.isstaggerelement="true" style="{themeresource listviewitemtextblockstyle}" text="{binding state, fallbackvalue=state}"/> <textblock grid.column="1" style="{themeresource listviewitemtextblockstyle}" text="{binding count, fallbackvalue=1}"/> </grid> </datatemplate> </listview.itemtemplate> </listview>
as can see, how count in right (the textblock bound count). problem each grid uses width needs instead of getting whole space
ideas??
thanks
try following:
inside <listview></listview>
tag, add following:
<listview.itemcontainerstyle> <style targettype="listviewitem"> <setter property="horizontalcontentalignment" value="stretch" /> </style> </listview.itemcontainerstyle>
Comments
Post a Comment