XAML windows 8 metro app, binding issue -
i using grouped gridview in windows 8 metro application, have variablesizedwrapgrid in itemspaneltemplate , , want bind maximumrowsorcolumns property, not binding correctly.
here xaml
<gridview itemssource="{binding source={staticresource groupeddata}}" > <gridview.itemtemplate> <datatemplate> <grid width="120" height="150" > <!--some controls here binded correctly.--> </grid> </datatemplate> </gridview.itemtemplate> <gridview.groupstyle> <groupstyle> <groupstyle.headertemplate> <datatemplate> <grid margin="1,0,0,6"> <stackpanel orientation="horizontal"> <textblock text="{binding maxgridcoulmns}"></textblock> <!--work ok here --> <textblock foreground="black" padding="0,0,0,20" text="{binding headertext}" /> </stackpanel> </grid> </datatemplate> </groupstyle.headertemplate> <groupstyle.panel > <itemspaneltemplate> <variablesizedwrapgrid orientation="horizontal" maximumrowsorcolumns="{binding maxgridcoulmns}" margin="0,0,80,0"/> <!--not binding here --> </itemspaneltemplate> </groupstyle.panel> </groupstyle> </gridview.groupstyle> </gridview>
you have cast dependencyproperty icollectionviewgroup actual group object.
in code var actualgroup = (group windows.ui.xaml.data.icollectionviewgroup).group; - in xaml have add prefix group. binding path.
so in xaml, edit binding this:
<itemspaneltemplate> <variablesizedwrapgrid orientation="horizontal" maximumrowsorcolumns="{binding group.maxgridcoulmns}" margin="0,0,80,0"/> </itemspaneltemplate>
Comments
Post a Comment