約 1500 の要素を含む ComboBox を作成しました。この ComboBox は、コレクションにストアド プロシージャを入力しても、最初は非常に遅くなります。どうすればよいですか?
ここにコードがあります`
<ComboBox Name="cbMember" TextSearch.TextPath="MemberFullName" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" IsEditable="True" Height="23" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" Margin="5,0,0,0" ItemsSource="{Binding MemberCollection}" SelectedItem="{Binding Path=SelectedSearchMember,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" KeyDown="cbMember_KeyDown" DropDownClosed="cbMember_DropDownClosed" SelectionChanged="cbMember_SelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding MemberFullName}" VerticalAlignment="Center" />
</DataTemplate>
</ComboBox.ItemTemplate>
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>`
ここにオブザーバブル コレクション コードを入力します。
MemberCollection = new ObservableCollection<PROC_MembersList_Result>(_context.PROC_MembersCollectionList().Where(c => c.IsHide != null && (bool)c.IsHide == true));