<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Template>
<ControlTemplate TargetType="ItemsControl">
<ScrollViewer MouseMove="ScrollViewer_MouseMove">
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</ItemsControl.Template>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Height="60" Width="200">
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding Value}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
----
<ListBox x:Name="demoList">
<ItemsControl x:Name="itemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Template>
<ControlTemplate TargetType="ItemsControl">
<ScrollViewer>
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</ItemsControl.Template>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Width="auto" Height="50" Background="Blue">
<TextBlock FontSize="46" Text="{Binding Name}"/>
<TextBlock Text="{Binding Value}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ListBox>
for (int i = 0; i < 1000; i++)
{
myTodoList p1 = new myTodoList();
p1.Name = i.ToString();
p1.Value = "111";
m_listStruct.Add(p1);
}
itemsControl.ItemsSource = m_listStruct;
----
<ListBox x:Name="demoList">
<ListBox.ItemTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<!--<Border Width="180" Height="180" Margin="10" Background="{StaticResource PhoneAccentBrush}">
<TextBlock Text="{Binding}"/>
</Border>-->
<StackPanel Margin="10" Width="180" Height="180" Background="Blue">
<TextBlock FontSize="46" Text="{Binding Name}"/>
<TextBlock Text="{Binding Value}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
for (int i = 0; i < 100; i++)
{
TestStruct p1 = new TestStruct();
p1.Name = i.ToString();
p1.Value = "111";
m_listStruct.Add(p1);
}
//demoList.ItemsSource = m_listStruct;
this.demoList.ItemsSource = new RowAdapter<TestStruct>(m_listStruct, 2);