I have this style:
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<StackPanel>
<Image Source="{Binding Path=local:AttachedProperties.Image}" Stretch="None" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Top"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The problem is that the binding does not work for a button:
<Button HorizontalAlignment="Center" Style="{StaticResource ButtonStyle}" VerticalAlignment="Center" Content="Button" local:AttachedProperties.Image="../Images/UserChart.png" Grid.RowSpan="2"/>
What I'm doing wrong?