<ListBox x:Name="listbox" Focusable="True" PreviewMouseWheel="listBox_PreviewMouseWheel" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" > </ListBox.Resources> <ListBox.ItemsPanel> <ItemsPanelTemplate> <local:Panel3D Loaded="OnPanel3DLoaded" CorX="{Binding ElementName=sliderX, Path=Value}" CorY="{Binding ElementName=sliderY, Path=Value}" CorZ="{Binding ElementName=sliderZ, Path=Value}" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="Width" Value="200" /> <Setter Property="Height" Value="200" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <ContentPresenter ContentSource="Content" /> </ControlTemplate> </Setter.Value> </Setter> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemTemplate> <DataTemplate> <Button x:Name="my" Onclick="DoThis"></Button> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)