title: Template for image with effects and triggers
body: <p>Hi I have wpf xaml code as shown below</p>
  
  <pre><code>&lt;Image Source="/MyProject;component/Resources/Icons/button_cancel_256.png"
     DockPanel.Dock="Right"
     Margin="0,1,10,1"
     RenderTransformOrigin="0.5,0.5"
     &gt;
  &lt;Image.RenderTransform&gt;
      &lt;ScaleTransform x:Name="ImageScaleTransform" 
                      ScaleX="1" ScaleY="1" 
                      /&gt;
  &lt;/Image.RenderTransform&gt;
      &lt;Image.Effect&gt;
         &lt;DropShadowEffect x:Name="ImageGlowEffect"
             BlurRadius="20"
             ShadowDepth="0"
             Color="White"&gt;
         &lt;/DropShadowEffect&gt;
     &lt;/Image.Effect&gt;
  &lt;Image.Triggers&gt;
      &lt;EventTrigger RoutedEvent="Image.MouseEnter"&gt;
          &lt;EventTrigger.Actions&gt;
              &lt;BeginStoryboard&gt;
                  &lt;Storyboard&gt;
                      &lt;ColorAnimation
                          Storyboard.TargetName="ImageGlowEffect"
                          Storyboard.TargetProperty="Color"
                          From="White"
                          To="Red"
                          Duration="0:0:1"&gt;
                      &lt;/ColorAnimation&gt;
                  &lt;/Storyboard&gt;
              &lt;/BeginStoryboard&gt;
          &lt;/EventTrigger.Actions&gt;
      &lt;/EventTrigger&gt;
      &lt;EventTrigger RoutedEvent="Image.MouseLeave"&gt;
          &lt;EventTrigger.Actions&gt;
              &lt;BeginStoryboard&gt;
                  &lt;Storyboard&gt;
                      &lt;ColorAnimation
                          Storyboard.TargetName="ImageGlowEffect"
                          Storyboard.TargetProperty="Color"
                          From="Red"
                          To="White"
                          Duration="0:0:1"&gt;
                      &lt;/ColorAnimation&gt;
                  &lt;/Storyboard&gt;
              &lt;/BeginStoryboard&gt;
          &lt;/EventTrigger.Actions&gt;
      &lt;/EventTrigger&gt;
      &lt;EventTrigger RoutedEvent="Image.MouseLeftButtonDown"&gt;
          &lt;EventTrigger.Actions&gt;
              &lt;BeginStoryboard&gt;
                  &lt;Storyboard&gt;
                      &lt;DoubleAnimation
                          Storyboard.TargetName="ImageScaleTransform"
                          Storyboard.TargetProperty="ScaleX"
                          From="1"
                          To=".9"
                          Duration="0:0:0.1"&gt;
                      &lt;/DoubleAnimation&gt;
                      &lt;DoubleAnimation
                          Storyboard.TargetName="ImageScaleTransform"
                          Storyboard.TargetProperty="ScaleY"
                          From="1"
                          To=".9"
                          Duration="0:0:0.1"&gt;
                      &lt;/DoubleAnimation&gt;
                  &lt;/Storyboard&gt;
              &lt;/BeginStoryboard&gt;
          &lt;/EventTrigger.Actions&gt;
      &lt;/EventTrigger&gt;
  
      &lt;EventTrigger RoutedEvent="Image.MouseLeftButtonUp"&gt;
          &lt;EventTrigger.Actions&gt;
              &lt;BeginStoryboard&gt;
                  &lt;Storyboard&gt;
                      &lt;DoubleAnimation
                          Storyboard.TargetName="ImageScaleTransform"
                          Storyboard.TargetProperty="ScaleX"
                          From=".9"
                          To="1"
                          Duration="0:0:0.1"&gt;
                      &lt;/DoubleAnimation&gt;
                      &lt;DoubleAnimation
                          Storyboard.TargetName="ImageScaleTransform"
                          Storyboard.TargetProperty="ScaleY"
                          From=".9"
                          To="1"
                          Duration="0:0:0.1"&gt;
                      &lt;/DoubleAnimation&gt;
                  &lt;/Storyboard&gt;
              &lt;/BeginStoryboard&gt;
          &lt;/EventTrigger.Actions&gt;
      &lt;/EventTrigger&gt;
  &lt;/Image.Triggers&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now i want to create a style or template so that I can apply this to other images where i can specify the color.</p>
  
  <p>Please help i have not been able to do it after various tries.</p>