I have the following ItemsControl
:
<ItemsControl x:Name="ListResult">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DockPanel>
<Image Margin="10,0,0,0"
Source="{Binding Pic}"/>
<TextBlock Text={Binding Info}/>
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
I bind the ItemsControl
's ItemsSource
to a List<>
.
Is it possible to put a different margin for each item?
For example:
ListResult[0].Margin="10,0,0,0";
ListResult[1].Margin="50,0,0,0";
ListResult[2].Margin="10,0,0,0";
ListResult[3].Margin="50,0,0,0";