ListBoxItem style in <ListBox.Resources> or in <ListBox.ItemContainerStyle>?
问题 I can put a xaml Style for ListBoxItem in <ListBox.Resources> or in <ListBox.ItemContainerStyle> . See code. Question is: what is the difference, what should I prefer? <ListBox.Resources> <Style TargetType="ListBoxItem"> <Setter Property="Canvas.Top" Value="{Binding Top}"/> <Setter Property="Canvas.Left" Value="{Binding Left}"/> <Setter Property="VerticalContentAlignment" Value="Stretch"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="Padding" Value="0"/> <