Synchronize Listbox SelectedItem with component
For synchronize SelectedItem with focused component in DataTemplate for exemple
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<ListBox VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Style.Triggers> <Trigger Property="IsKeyboardFocusWithin" Value="True"> <Setter Property="IsSelected" Value="True" /> </Trigger> </Style.Triggers> </Style> </ListBox.ItemContainerStyle> </ListBox> |
Commentaires récents