Page 1 of 1

ItemsControl binding to large List > slow

Posted: 18 Mar 2016, 14:33
by jeroenvdv
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:
<ItemsControl x:Name="tracklist" ItemsSource="{Binding rekords}" VerticalAlignment="Top" ItemTemplate="{DynamicResource trackListItemTemplate}" ItemsPanel="{DynamicResource trackListPanelTemplate}" Foreground="{x:Null}" Padding="-2"/>

with the DataTemplate:
<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

Posted: 18 Mar 2016, 15:52
by jsantos
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!

Re: ItemsControl binding to large List > slow

Posted: 20 Mar 2016, 19:51
by jeroenvdv
Will do! Thanks.

Re: ItemsControl binding to large List > slow

Posted: 29 Apr 2016, 14:57
by jsantos
Massive improvements regarding this in v1.2.6

Re: ItemsControl binding to large List > slow

Posted: 28 May 2016, 14:47
by jeroenvdv
Sorry for late reply.

Thumbs up for 1.2.6: Massive improvements indeed :) Thank you!

Re: ItemsControl binding to large List > slow

Posted: 01 Jun 2016, 01:21
by jsantos
Thanks for commenting!