UserControls and WrapPanel

Topics: Prism v2 - Silverlight 3
Aug 12, 2009 at 9:56 PM
Edited Aug 12, 2009 at 9:58 PM

Hello,

I am trying to bind an ObservableArray of UserControl items to a WrapPanel as shown below:

<ItemsControl x:Name="ImageTable" ItemsSource="{Binding SystemObjectViewItems}">

<ItemsControl.ItemsPanel>

<ItemsPanelTemplate>

<Controls:WrapPanel/>

</ItemsPanelTemplate>

</ItemsControl.ItemsPanel>

<ItemsControl.ItemTemplate>

<DataTemplate>

<Grid>

<MyUserControl></MyUserControl>

</Grid>

</DataTemplate>

</ItemsControl.ItemTemplate>

</ItemsControl>

The above xaml works fine for a collection of strings but not for a collection of my own UserControls.

What am I doing wrong?

Rick