ItemsControl binding to large List > slow
Hi,
I've got a ItemsControl, binded to a fairly large List<CRekord> where CRekord has several properties. The list is populated with +- 900 CRekords during startup.
I found this to take fairly long: 30 seconds on a very fast Macbook Pro. The problem is in the UI updating (as I populate the complete list, then fire the PropertyChanged).
XAML:
with the DataTemplate:
I've got a ItemsControl, binded to a fairly large List<CRekord> where CRekord has several properties. The list is populated with +- 900 CRekords during startup.
I found this to take fairly long: 30 seconds on a very fast Macbook Pro. The problem is in the UI updating (as I populate the complete list, then fire the PropertyChanged).
XAML:
Code: Select all
<ItemsControl x:Name="tracklist" ItemsSource="{Binding rekords}" VerticalAlignment="Top" ItemTemplate="{DynamicResource trackListItemTemplate}" ItemsPanel="{DynamicResource trackListPanelTemplate}" Foreground="{x:Null}" Padding="-2"/>
with the DataTemplate:
Code: Select all
<DataTemplate x:Key="trackListItemTemplate">
<Border BorderBrush="#FF0A0A0A" BorderThickness="0,2,0,0">
<Grid x:Name="trackListItemGrid" Width="Auto" Margin="0" ScrollViewer.VerticalScrollBarVisibility="Disabled" Height="20" Background="Black" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label x:Name="tracklistIndexLabel" Content="{Binding indexString, FallbackValue=000}" FontSize="12" FontWeight="Bold" Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="0" Height="Auto" VerticalContentAlignment="Stretch" Grid.ColumnSpan="1" IsEnabled="{Binding hasTimecode, FallbackValue=false}" Foreground="#333333" />
<Label x:Name="tracklistTitleLabel" Content="{Binding tagTitle, FallbackValue=Title}" FontSize="12" FontWeight="Bold" Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="0" Height="Auto" VerticalContentAlignment="Stretch" Grid.ColumnSpan="1" IsEnabled="{Binding playing, FallbackValue=false}" Foreground="White" Grid.Column="1" MinWidth="0" Width="350" />
<CheckBox Content="" HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding hasTimecode}" Grid.Column="2" Background="Black" BorderBrush="#FF636363" Foreground="Black" Width="Auto" Height="Auto"/>
</Grid>
</Border>
<DataTemplate.Triggers>
<Trigger Property="IsEnabled" Value="true" SourceName="tracklistIndexLabel">
<Setter Property="Foreground" TargetName="tracklistIndexLabel" Value="White"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false" SourceName="tracklistIndexLabel">
<Setter Property="Foreground" TargetName="tracklistIndexLabel" Value="#FF555555"/>
</Trigger>
<Trigger Property="IsEnabled" Value="true" SourceName="tracklistTitleLabel">
<Setter Property="Foreground" TargetName="tracklistTitleLabel" Value="#FF46D246"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false" SourceName="tracklistTitleLabel">
<Setter Property="Foreground" TargetName="tracklistTitleLabel" Value="#FFFFFFFF"/>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
Re: ItemsControl binding to large List > slow
This is one of the improvements included in the upcoming 1.2.6 version. If you want to test it, could you create a report in the tracker? We will send you a preview there.
Thanks for your feedback!
Thanks for your feedback!
Re: ItemsControl binding to large List > slow
Massive improvements regarding this in v1.2.6
Re: ItemsControl binding to large List > slow
Sorry for late reply.
Thumbs up for 1.2.6: Massive improvements indeed Thank you!
Thumbs up for 1.2.6: Massive improvements indeed Thank you!
Re: ItemsControl binding to large List > slow
Thanks for commenting!
Who is online
Users browsing this forum: No registered users and 1 guest