У меня есть WPF ListBox, который содержит CheckBox
следующим образом:
<ListBox x:Name="MyListBox"
Grid.Row="1"
ItemsSource="{Binding Path=Customers}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding Path=ReceiveNewsletter}"
Margin="0,3,0,0"
IsTabStop="False"/>
<TextBlock Text="{Binding Path=FirstName}" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Но у меня проблема с выделением ListBoxItem
. Когда я нажимаю CheckBox
, ListBoxItem
не выделяется.
Может кто-нибудь подсказать, как решить проблему?
Спасибо