c# - Wrap Panel Design Issues in WPF for WIndows 8 -
i displaying calendar user wpf application. have observable collection , binding these collections viewmodel.in order display calendar (first 7 columns in first row, second 7 columns in next rows ect),i using "wrap panel".the below code works in windows 7.but when tried run in windows 8,i can see first 5 columns displaying in row. how can solvemit?is there problem wrap panel width in windows 8 os?
<listbox x:name="lsticon" grid.row="1" itemssource="{binding calenderdatalist}" background="#fff9f9f9" > <listbox.itemspanel> <itemspaneltemplate> <wrappanel orientation="horizontal" width="245"> </wrappanel> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> <datatemplate> <stackpanel orientation="vertical" width="33" height="60"> <textblock width="15" text="{binding day}" horizontalalignment="left" verticalalignment="center" fontsize="10" foreground="red" /> <stackpanel background="{binding isdropped,converter={staticresource booleantobackgroundconvertor}}" > <textblock width="25" text="{binding from}" horizontalalignment="left" verticalalignment="center" fontsize="10" /> <textblock width="25" text="{binding to}" horizontalalignment="left" verticalalignment="center" fontsize="10" /> <textblock width="25" text="{binding time}" horizontalalignment="left" verticalalignment="center" fontsize="10" /> </stackpanel> </stackpanel> </datatemplate> </listbox.itemtemplate> </listbox>
since datatemplate items having fixed size, set itemwidth property wrappanel. like,
<wrappanel orientation="horizontal" width="245" itemwidth="33"> </wrappanel>
Comments
Post a Comment