Hi, I'm trying to create fancy looking Listbox. ListBoxItems are supposed to expand after being selected, but the problem is, they're also supposed to contain another ListBox filled with some details about particular item and I have no idea how to put some data into it. I've tried both accessing it from C# code and binding it in XAML but I'm still nowhere near the solution.
<UserControl.Resources>
<ResourceDictionary>
<DataTemplate x:Key="SelectedTemplate">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path = Order}" Style="{StaticResource SampleListCellItem}" MinWidth="35"/>
<TextBlock Text="{Binding Path = FullName}" Style="{StaticResource SampleListCellItem}" Width="340"/>
<TextBlock Text="{Binding Path = FirstName}" Style="{StaticResource SampleListCellItem}" Width="200" />
<TextBlock Text="{Binding Path = BirthDate, StringFormat = d}" Style="{StaticResource SampleListCellItem}" Width="100"/>
</StackPanel>
<StackPanel HorizontalAlignment="Right">
<ListBox Name="InnerList" Height="200" Width="200"/>
<Button Name="Button1" Height="40" Width="100" Content="ButtonText" Visibility="Visible"/>
</StackPanel>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ItemTemplate">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path = Order}" Style="{StaticResource SampleListCellItem}" MinWidth="35"/>
<TextBlock Text="{Binding Path = FullName}" Style="{StaticResource SampleListCellItem}" Width="340"/>
<TextBlock Text="{Binding Path = FirstName}" Style="{StaticResource SampleListCellItem}" Width="200" />
<TextBlock Text="{Binding Path = BirthDate, StringFormat = d}" Style="{StaticResource SampleListCellItem}" Width="100"/>
</StackPanel>
</StackPanel>
</DataTemplate>
<Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
<Setter Property="ContentTemplate" Value="{StaticResource ItemTemplate}"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="ContentTemplate" Value="{StaticResource SelectedTemplate}"/>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</UserControl.Resources>