Wpf databinding in the resourcedictionary
<p>I've recently started using C# WPF since it has more options to decorate the controls. Now I wanted to try and make a button that has a icon with the text next to it and after a little search i found <a href="https://stackoverflow.com/questions/17630968/wpf-c-sharp-button-style">a post that seemed helpfull</a>. And I think that im on the right way of getting what I want, But I can't figure out how I can make it so I can assign the icon for each button individually.</p>

<p>This is the code I'm currently using for the button:</p>

<pre><code>&lt;!-- Resource Dictionary--&gt;
&lt;Style TargetType="{x:Type Button}" x:Key="Test"&gt;
    &lt;Setter Property="Background" Value="#373737" /&gt;
    &lt;Setter Property="Foreground" Value="White" /&gt;
    &lt;Setter Property="FontSize" Value="15" /&gt;
    &lt;Setter Property="SnapsToDevicePixels" Value="True" /&gt;

    &lt;Setter Property="Template"&gt;
        &lt;Setter.Value&gt;
            &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                &lt;Border CornerRadius="4" Background="{TemplateBinding Background}"&gt;
                    &lt;Grid&gt;
                        &lt;Canvas x:Name="ButtonImage" Width="40" Height="40" HorizontalAlignment="Left" Margin="10,0,0,0"&gt;
                            &lt;Canvas.Background&gt;
                                &lt;ImageBrush ImageSource="F:\Deze Pc\Afbeeldingen\Icons\Steel Series\Documents.ico"/&gt;
                            &lt;/Canvas.Background&gt;
                        &lt;/Canvas&gt;
                        &lt;Path x:Name="PathIcon" Width="15" Height="25" Stretch="Fill" Fill="#4C87B3" HorizontalAlignment="Left" Margin="20,0,0,0" /&gt;
                        &lt;ContentPresenter x:Name="MyContentPresenter" Content="{TemplateBinding Content}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="60,0,0,0" /&gt;
                    &lt;/Grid&gt;
                &lt;/Border&gt;

                &lt;ControlTemplate.Triggers&gt;
                    &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                        &lt;Setter Property="Background" Value="#E59400" /&gt;
                        &lt;Setter Property="Foreground" Value="White" /&gt;
                        &lt;Setter TargetName="PathIcon" Property="Fill" Value="Black" /&gt;
                    &lt;/Trigger&gt;

                    &lt;Trigger Property="IsPressed" Value="True"&gt;
                        &lt;Setter Property="Background" Value="OrangeRed" /&gt;
                        &lt;Setter Property="Foreground" Value="White" /&gt;
                    &lt;/Trigger&gt;
                &lt;/ControlTemplate.Triggers&gt;
            &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
&lt;/Style&gt;

&lt;!--Window Xaml --&gt;
&lt;Button Width="200" Height="50" VerticalAlignment="Top"  Grid.Row="2" Style="{StaticResource Test}" &gt;
        &lt;Button.Content&gt;
            &lt;StackPanel&gt;
                &lt;TextBlock Text="Button text here" FontSize="20" /&gt;
            &lt;/StackPanel&gt;
        &lt;/Button.Content&gt;
    &lt;/Button&gt;
</code></pre>

<p>But now was my question, how do I make it so I can set the image on the window xaml side rather then in the resource dictionary so that I'm able to give diffrent icons to diffrent buttons without needing to make a style for each of them.</p>