title: Help me put event trigger for controls of type Expander!
body: <p>Hello im trying to do something like this</p>
  
  <pre><code>  allrooms = remote.GetAllRooms();
          for (int a = 0; a &lt; allrooms.Count; a++) {
              Expander ex = new Expander();
              ex.Expanded += expander1_Expanded;
              ex.Width = 254;
              ex.Name = ("expander" + a);
              ex.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
              ex.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
              ex.Header = allrooms[a].nome;
              WrapPanel panel = new WrapPanel();
              panel.Opacity = 1;
              panel.Width = 254;
              for (int b = 0; b &lt; allusers.Count; b++) {
                  System.Windows.Controls.Label lbl = new System.Windows.Controls.Label();
                  lbl.Content = allusers[b].nick;
                  lbl.Width = 127;
                  panel.Children.Add(lbl);
              }
              ex.Content = panel;
              Canvas.SetTop(ex, (30 * a));
              canvasleft.Children.Add(ex);
          }
          myTimer.Stop();
  </code></pre>
  
  <p>And now my objective is to add this event trigger to that Expanders created, in xaml or c#.</p>
  
  <pre><code>    &lt;Canvas.Triggers&gt;
          &lt;EventTrigger RoutedEvent="Expander.Expanded" SourceName="expander"&gt;
              &lt;EventTrigger.Actions&gt;
                  &lt;BeginStoryboard&gt;
                      &lt;Storyboard&gt;
                          &lt;DoubleAnimation From="0" To="1" Duration="0:0:0.25" Storyboard.TargetName="listBox" Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(ScaleTransform.ScaleY)"/&gt;
                      &lt;/Storyboard&gt;
                  &lt;/BeginStoryboard&gt;
              &lt;/EventTrigger.Actions&gt;
          &lt;/EventTrigger&gt;
      &lt;/Canvas.Triggers&gt;
  </code></pre>
  
  <p>Something like that but that have errors and what i need is something like <code>x:Type Expander</code> for all created expanders in the canvas.</p>
  
  <p>Can anybody help me?</p>