Quantcast
Viewing latest article 1
Browse Latest Browse All 801

Created Unassigned: usercontrol loaded event doesn't fire, missing loaded event [12964]

When there are many items in listbox, the listbox item template loaded event doesn't fire.

I have made a template for the ItemTemplate property of ListBox:
```
<ListBox x:Name="lb" Grid.Row="1">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<local:ListBoxItemTemplate />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
```
I have handled the loaded event of local:ListBoxItemTemplate :

```
void ListBoxItemTemplate_Loaded(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine(i++);
}
```

But, on my side, when the items number is over 5000, there are some loaded event doesn't fire.
When I increase the number to 100000, there is no loaded event any more.
Is this a bug? Or I missed any thing?

Viewing latest article 1
Browse Latest Browse All 801

Trending Articles