Hi All,
I am creating a search page for books. There are lacks of data in the database. If the data size is more than 2000 the application is getting hanged. ItemsSource of the listbox having the data but something wrong is happening behind.
Code
<ListBox Grid.Column="1" x:Name="lbResult" ItemsSource="{Binding}" SelectionChanged="lbResult_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Width="320">
<TextBlock Margin="10"><InlineUIContainer>
<TextBlock Foreground="DarkKhaki" Text="{Binding Title}"/>
</InlineUIContainer><Run Text=" "/><LineBreak/><InlineUIContainer>
<TextBlock Text=" By "/>
</InlineUIContainer><Run Text=" "/><InlineUIContainer>
<TextBlock Text="{Binding Author}"/>
</InlineUIContainer></TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>