user controls - Silverlight WrapPanel not displaying items consistently -


we use wrappanel display varying number of buttons (actually usercontrols behave buttons). inside each wrappanel itemscontrol items. oftentimes wrappanel doesn’t display items—if there 4 see 1 or two. behavior not consistent.

is there we’re doing wrong? there known issues using wrappanel this?

for xaml, usercontrol in our main window:

<usercontrol x:name="uccatalogcontent" grid.row="2">    <local:catalog_categoryview /> 

this categoryview markup. has itemscontrol. items other usercontrols wrappanel inside them:

<usercontrol    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"     xmlns:local="clr-namespace:catalog;assembly=catalog"       x:class="catalog.catalog_categoryview"    >     <usercontrol.resources>            <datatemplate x:key="categorydt" >                  <local:category />           </datatemplate>     </usercontrol.resources>     <scrollviewer x:name="scvcatalogcategoryview"            horizontalscrollbarvisibility="disabled">            <!-- item should bound collection of categories -->           <itemscontrol x:name="iccategories"                   itemtemplate="{staticresource categorydt}"           >            <local:category x:name="item1" />           <local:category x:name="item2" />           <local:category x:name="item3" />            </itemscontrol>     </scrollviewer> 

and individual category, wrappanel used:

<usercontrol    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"         xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"     xmlns:custom="clr-namespace:customcontrolresources;assembly=customcontrolresources"    xmlns:local="clr-namespace:catalog;assembly=catalog"       x:class="catalog.category"    >     <usercontrol.resources>            <itemspaneltemplate x:key="categoryitempanel">                                               <toolkit:wrappanel                          verticalalignment="top"                         horizontalalignment="stretch"                         />                                                                                            </itemspaneltemplate>             <datatemplate x:key="offeringdt" >                  <local:offeringtile x:name="offeringtile" />           </datatemplate>     </usercontrol.resources>     <grid x:name="layoutroot" style="{staticresource contentrootstyle}">            <grid.rowdefinitions>                  <rowdefinition height="auto" />                  <rowdefinition height="*" />                               </grid.rowdefinitions>             <custom:blockexpander x:name="expcategoryexpander"                  title="access [bind me]">                   <custom:blockexpander.blockexpandercontent>                         <itemscontrol x:name="icserviceofferingslist"                               itemspanel="{staticresource categoryitempanel}"                                itemtemplate="{staticresource offeringdt}"                               >                               <local:offeringtile />                               <local:offeringtile />                               <local:offeringtile />                               <local:offeringtile />                         </itemscontrol>                                             </custom:blockexpander.blockexpandercontent>            </custom:blockexpander>     </grid> 

in screenshot, there should title on each expander header (by blue triangle), , each group should contain 4 items: wrappanels not showing items

it turns out there interaction between expander usercontrol , wrappanel. removed codebehind, wrappanel behaved normally.

we worked around styling toolkit's expander. weren't using toolkit, since needed wrappanel....


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -