virtualizingstackpanel

VirtualizingStackPanel + MVVM + multiple selection

烂漫一生 提交于 2019-11-26 15:24:29
问题 I have implemented a selection pattern similar to the one described in this post using a ViewModel to store the IsSelected value, and by binding the ListViewItem.IsSelected to the ViewModel IsSelected: <ListView.ItemContainerStyle> <Style TargetType="{x:Type ListViewItem}"> <Setter Property="IsSelected" Value="{Binding Mode=TwoWay, Path=IsSelected}"/> </Style> </ListView.ItemContainerStyle> It works in general, but I encounter a severe problem. By using the a VirtualizingStackPanel as the

Virtualizing an ItemsControl?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-25 22:37:36
问题 I have an ItemsControl containing a list of data that I would like to virtualize, however VirtualizingStackPanel.IsVirtualizing=\"True\" does not seem to work with an ItemsControl . Is this really the case or is there another way of doing this that I am not aware of? To test I have been using the following block of code: <ItemsControl ItemsSource=\"{Binding Path=AccountViews.Tables[0]}\" VirtualizingStackPanel.IsVirtualizing=\"True\"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock