for some reason I returned to one my project in Silverlight Windows Phone 7.x
So I download VS2012 for WP and opened in past working solution. The problem is, now it's not working.
When I start debug, emulator throws me exception with text:
ExceptionObject {MS.Internal.WrappedException: The ItemsControl.ItemsPanelTemplate must have a derivative of Panel as the root element. ---> System.InvalidOperationException: The ItemsControl.ItemsPanelTemplate must have a derivative of Panel as the root element.
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at Microsoft.Phone.Controls.PivotItem.MeasureOverride(Size availableSize)
I suppose problem is here (when I comment following code it's working)
<controls:PivotItem Header="{Binding Path=LocalizedResources.Categories, Source={StaticResource LocalizedStrings}}" Margin="0,12,0,0">
<ItemsControl x:Name="_categories" ItemsSource="{Binding CategoriesVM.Categories}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<ScrollViewer>
<local2:UniformGrid Rows="4" Columns="2"/>
</ScrollViewer>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Border Margin="9,0" Padding="0" BorderThickness="1" BorderBrush="White" Height="212" Width="210" Canvas.ZIndex="1">
<Image local:LowProfileImageLoader.UriSource="{Binding imgsrc}" Margin="0" Width="210" Height="210" />
</Border>
<Rectangle Width="210" Height="39" Canvas.ZIndex="2" Fill="#FF8DFFFA" VerticalAlignment="Bottom" Margin="0,0,0,10" Opacity="0.8" />
<TextBlock Text="{Binding name}" Canvas.ZIndex="4" VerticalAlignment="Bottom" Margin="25,0,0,17" Foreground="#FFCD1A1A" HorizontalAlignment="Left" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</controls:PivotItem>
I am not quite sure what that exception means, could somebody help me how to fix it please?
Thanks in advance