I have a WPF style as follow
<!-- Home Button Style -->
<Style x:Key="HomeButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="Margin"
Value="4" />
<Setter Property="Template"
Value="{StaticResource HomeAnimation}" />

And then the StaticResource HomeAnimation' ControTemplate defined as follow

<ControlTemplate x:Key="HomeAnimation" TargetType="{x:Type Button}">
<Grid Width="Auto" Height="Auto" Background="{x:Null}" RenderTransformOrigin="0.485,0.533">
<Rectangle Fill="{StaticResource DrawBrushIconHome}" Stroke="{x:Null}" HorizontalAlignment="Left" Margin="13.166,50.218,0,0" VerticalAlignment="Top" x:Name="rectangle1" Width="20" Height="20" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
<ScaleTransform ScaleX="1" ScaleY="-1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform X="0" Y="0"/>

In the above controlTemplate there is a Rectangle Fill option with StaticResource "DrawBrushIconHome"

The DrawBrushIconHome defined as follow in the resource file

<DrawingBrush x:Key="DrawBrushIconHome" Viewbox="0,0,77.304,70" ViewboxUnits="Absolute">
<ImageDrawing Rect="0,0,77.304,70">
<BitmapImage CacheOption="OnLoad" CreateOptions="IgnoreImageCache" UriSource="/Resources/home.png"/>

Now my problem is how to Change the DrawBrushIconHome's UriSource images. I mean I dont want to load home.png from Resources and I would make it dynamic. So that I have to assign the image programatically from a external folder.

Can Some one please help How I can programatically set the URiSource of DrawBrushIconHome which belongs to HomeAnimation ControlTemplate and which belongs to a Button Style HomeButtonStyle.

I use C# for the development