jeroenvdv
Topic Author
Posts: 13
Joined: 15 Sep 2014, 20:21

ItemsControl binding to large List > slow

18 Mar 2016, 14:33

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>
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: ItemsControl binding to large List > slow

18 Mar 2016, 15:52

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!
 
jeroenvdv
Topic Author
Posts: 13
Joined: 15 Sep 2014, 20:21

Re: ItemsControl binding to large List > slow

20 Mar 2016, 19:51

Will do! Thanks.
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: ItemsControl binding to large List > slow

29 Apr 2016, 14:57

Massive improvements regarding this in v1.2.6
 
jeroenvdv
Topic Author
Posts: 13
Joined: 15 Sep 2014, 20:21

Re: ItemsControl binding to large List > slow

28 May 2016, 14:47

Sorry for late reply.

Thumbs up for 1.2.6: Massive improvements indeed :) Thank you!
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: ItemsControl binding to large List > slow

01 Jun 2016, 01:21

Thanks for commenting!

Who is online

Users browsing this forum: No registered users and 1 guest