In this template ItemPresenter just defines host panel for the Items. Is it possible to define ItemTemplate?
<ControlTemplate x:Key="ItemsControlTemplate" TargetType="ItemsControl">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ScrollViewer>
<ItemsPresenter Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/>
</ScrollViewer>
</Grid>
</ControlTemplate>
To go further, I've created a class:
public class ItemsControlExtended : ItemsControl
{
public ItemsControlExtended()
{
DefaultStyleKey = typeof(ItemsControlExtended);
}
}
And I would like to create a dependency property "ItemsMargin". After I've done that I'm supposed to bind an Item "Margin" property to "ItemsMargin". How it would be possible to implement?
GetContainerForItemOverride ? PrepareContainerForItemOverride ? OnApplyTemplate ?