i trying implement custom multi-page dialog takes arbitrary number of visuals (slides) , displays them. desired behavior selected item appear @ top-center of display area in foreground. previous slide @ bottom-left lower z-index, , next slide @ bottom-right lower z-index. "previous" , "next" buttons set selected index. in set method index, loop through slides , set integer value called "selectionstate" based on whether each slide hidden, selected, before selected one, or after selected one. trying position slides based on integer using ivalueconverters.
for listbox.itemspaneltemplate, tried using grid. in itemstemplate, setting grid.column , grid.row using ivalueconverters. stepping through code, can see value converters being called, , returning appropriate values, items appear in row 0, column 0 anyway.
after getting frustrated, tried changing grid canvas , setting canvas.left , canvas.top properties, , again, can see getting values converter, items position in top-left corner anyway. (this code shown, commented out)
since know value converters behaving expected, else see doing wrong? thank in advance suggestions!
<grid x:name="dialoglayer"> <grid.rowdefinitions> <rowdefinition height="*" /> <rowdefinition height="420" /> <rowdefinition height="*" /> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition width="*" /> <columndefinition width="1100" /> <columndefinition width="*" /> </grid.columndefinitions> <listbox x:name="lbslides" itemssource="{binding currentformset.interviewslides}" grid.column="1" grid.row="1" scrollviewer.horizontalscrollbarvisibility="hidden" scrollviewer.verticalscrollbarvisibility="hidden"> <listbox.itemspanel> <itemspaneltemplate> <grid> <grid.columndefinitions> <columndefinition width="250" /> <columndefinition width="250" /> <columndefinition width="100" /> <columndefinition width="250" /> <columndefinition width="250" /> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="60" /> <rowdefinition height="300" /> <rowdefinition height="60" /> </grid.rowdefinitions> </grid> <!--<canvas grid.row="1" grid.column="1" />--> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> <datatemplate> <!--<border borderbrush="black" borderthickness="1" width="600" height="360" canvas.top="{binding selectionstate, converter={staticresource selectionstatetocanvastopconverter}}" canvas.left="{binding selectionstate, converter={staticresource selectionstatetocanvasleftconverter}}" panel.zindex="{binding selectionstate, converter={staticresource selectionstatetozindexconverter}}"> <textblock text="hello world" /> </border>--> <border borderbrush="black" borderthickness="1" width="600" height="360" grid.column="{binding selectionstate, converter={staticresource selectionstatetogridcolumnconverter}}" grid.row="{binding selectionstate, converter={staticresource selectionstatetogridrowconverter}}" panel.zindex="{binding selectionstate, converter={staticresource selectionstatetozindexconverter}}"> <textblock text="hello world" /> </border> </datatemplate> </listbox.itemtemplate> </listbox> </grid>
you have set properties on item container (i.e. listboxitem) setting itemcontainerstyle
property:
<listbox.itemcontainerstyle> <style targettype="listboxitem"> <setter property="grid.column" value="{binding selectionstate, ...}"/> <setter property="grid.row" value="{binding selectionstate, ...}"/> <setter property="panel.zindex" value="{binding selectionstate, ...}"/> </style> </listbox.itemcontainerstyle> <listbox.itemtemplate> <datatemplate> <border borderbrush="black" borderthickness="1" width="600" height="360"> <textblock text="hello world" /> </border> </datatemplate> </listbox.itemtemplate>
Comments
Post a Comment