title: WPF Interaction triggers in a Style to invoke commands on View Model
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1647815/how-to-add-a-blend-behavior-in-a-style-setter">How to add a Blend Behavior in a Style Setter</a>  </p>
  </blockquote>
  
  
  
  <p>when I use an interaction trigger in a style,  I am getting the following error, 'triggers is not attachable element of type style'.  Any explanation what this error actually means and how to solve it. </p>
  
  <p>For reference take a look at MVVM Light toolkit's EventToCommand example.</p>
  
  <p>In this particular case, I am using Timeline control from Infragistics which represents events as EventTitle and when the EventTitle is clicked, I would like to raise the command (Note that Timeline control doesn't define any event like EventTitleClicked). Currently I am able to achieve the functionality by using events and calling my ViewModel method from the code behind, instead I would like to invoke the command directly from xaml. </p>
  
  <pre><code>&lt;Style x:Key="EventTitleTopStyle" TargetType="igTl:EventTitle"&gt;
      &lt;!-- The following is not working --&gt;
      &lt;i:Interaction.Triggers&gt;
          &lt;i:EventTrigger EventName="MouseLeftButtonDown"&gt;
              &lt;!--&lt;cmd:EventToCommand Command="{Binding MyCommand}" /&gt;--&gt;
          &lt;/i:EventTrigger&gt;
      &lt;/i:Interaction.Triggers&gt;
  
     &lt;!-- Using event setter instead to achieve the same --&gt;
      &lt;EventSetter Event="MouseLeftButtonDown" Handler="TopTitleMouseLeftButtonDown" /&gt;
      ....
  </code></pre>