Styling a ListBoxItem depending on its index in the ListBox
问题 I want to change the margin of the first item in the ListBox if SomeProperty value is 10, without code-behind. This is what I have so far: <ListBox x:Class="Windows.CustomList" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Windows" mc:Ignorable="d" x:Name="MyList