Sunday 15 August 2010

c# - ItemsControl has space between items -



c# - ItemsControl has space between items -

i have space between items , cant remove it. have been googling itemscontrol day , found nil works. didn't work listbox. made worse.

anyone has idea?

here code:

<itemscontrol borderthickness="0" itemssource="{binding items}" verticalalignment="stretch" verticalcontentalignment="stretch"> <itemscontrol.itemcontainerstyle> <style> <setter property="frameworkelement.margin" value="0,0,0,0"/> </style> </itemscontrol.itemcontainerstyle> <itemscontrol.itemtemplate> <datatemplate datatype="{x:type newssubscriber:item}"> <border verticalalignment="stretch" snapstodevicepixels="true" borderthickness="0"> <border.background> <imagebrush stretch="fill" imagesource="{binding repeatimagepath}"/> </border.background> <stackpanel cursor="hand" verticalalignment="stretch"> <stackpanel.inputbindings> <mousebinding mouseaction="leftclick" gesture="leftclick" command="{binding gotowebcommand}" /> </stackpanel.inputbindings> <stackpanel verticalalignment="stretch" flowdirection="righttoleft" height="{binding hight}" orientation="horizontal" horizontalalignment="right"> <stackpanel.background> <imagebrush stretch="fill" imagesource="{binding repeatimagepath}"/> </stackpanel.background> <textblock horizontalalignment="center" verticalalignment="center" textalignment="center" width="70" text="{binding time}"/> <textblock language="he-il" textwrapping="wrap" horizontalalignment="right" verticalalignment="center" width="300" text="{binding title}"/> <stackpanel horizontalalignment="center" verticalalignment="center" width="38"> <image stretch="none" source="{binding arrowimagepath}"/> </stackpanel> </stackpanel> </stackpanel> </border> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol>

output pic:

you have height="{binding hight}" property set big value.

<stackpanel verticalalignment="stretch" flowdirection="righttoleft" height="{binding hight}" orientation="horizontal" horizontalalignment="right">

c# wpf wpf-controls itemscontrol

No comments:

Post a Comment