私は非常に単純なテスト アプリケーションを持っています。ここには 2 つのオブジェクトがあり、それぞれにアイテムの小さなコレクションがあります。オブジェクトを選択すると、そのコレクションが WPFToolkit DataGrid に表示されます。
問題は、上/下キーを押してオブジェクト間の選択を切り替えると、それが追いつかないことがわかるような、顕著な遅延があることです。
なんでこんなに成績悪いの?
<Window x:Class="SlowGridBinding.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<ListBox ItemsSource="{Binding Shops}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True"/>
<Controls:DataGrid ItemsSource="{Binding Shops/Vegetables}" AutoGenerateColumns="True"/>
</StackPanel>
DataContext には、50 項目のランダム テスト データで満たされたいくつかのテスト クラスが取り込まれます。