<p>I create ItemsControl: </p>
<p> <ItemsControl Grid.ColumnSpan="3" ItemsSource="{Binding MyItemsSource}" ItemTemplate="{StaticResource MyDataTemplate}" /></p>
<p> </p>
<p>ItemsControl has MyDataTemplate:</p>
<p> </p>
<p><DataTemplate x:Key="DayShiftViewModelDataTemplate"></p>
<p> <Grid Background="Red"></p>
<p> <TextBlock Text="FooText"/> </p>
<p> <controlsInputToolkit:ContextMenuService.ContextMenu></p>
<p> <controlsInputToolkit:ContextMenu ></p>
<p> <controlsInputToolkit:MenuItem UseLayoutRounding="False" Header="asdfsdf" Command="{Binding AddNewShiftCommand}"/></p>
<p> </controlsInputToolkit:ContextMenu></p>
<p> </controlsInputToolkit:ContextMenuService.ContextMenu></p>
<p> </Grid> </p>
<p> </DataTemplate></p>
<p> </p>
<p>When I clear the collection of ItemsSource and add new elements , my application starts to slow.</p>
<p>If I delete Context Menu from DataTemplate, application works well.</p>
Comments: ** Comment from web user: kskog **
<p> <ItemsControl Grid.ColumnSpan="3" ItemsSource="{Binding MyItemsSource}" ItemTemplate="{StaticResource MyDataTemplate}" /></p>
<p> </p>
<p>ItemsControl has MyDataTemplate:</p>
<p> </p>
<p><DataTemplate x:Key="DayShiftViewModelDataTemplate"></p>
<p> <Grid Background="Red"></p>
<p> <TextBlock Text="FooText"/> </p>
<p> <controlsInputToolkit:ContextMenuService.ContextMenu></p>
<p> <controlsInputToolkit:ContextMenu ></p>
<p> <controlsInputToolkit:MenuItem UseLayoutRounding="False" Header="asdfsdf" Command="{Binding AddNewShiftCommand}"/></p>
<p> </controlsInputToolkit:ContextMenu></p>
<p> </controlsInputToolkit:ContextMenuService.ContextMenu></p>
<p> </Grid> </p>
<p> </DataTemplate></p>
<p> </p>
<p>When I clear the collection of ItemsSource and add new elements , my application starts to slow.</p>
<p>If I delete Context Menu from DataTemplate, application works well.</p>
Comments: ** Comment from web user: kskog **
I am not sure this is the same issue, but my Silverlight app has a lot of usercontrol instances with attached ContextMenu. When the number of usercontrol instances becomes large it significantly slows down the UI thread. Why are these serious bugs not fixed?? Maybe I'll just switch to Android right away...