title: WPF Window.Loaded and Window.Closed
body: <p>There are two event triggers. One of them is <code>RoundedEvent</code> <code>Window.Loaded</code> and the the other <code>Window.Closed</code>.
  But both of them does not work at the same time. How can I fix The problem?</p>
  
  <p>My code is below</p>
  
  <pre><code>&lt;Window.Triggers&gt;
      &lt;EventTrigger RoutedEvent="Window.Closed"&gt;
          &lt;BeginStoryboard&gt;
              &lt;Storyboard&gt;
                  &lt;DoubleAnimation  Storyboard.TargetName="mainWindow" 
          Storyboard.TargetProperty="Left"
          From="500" To="-200" Duration="0:0:1" &gt;
                  &lt;/DoubleAnimation&gt;
              &lt;/Storyboard&gt;
          &lt;/BeginStoryboard&gt;
      &lt;/EventTrigger&gt;
  
      &lt;EventTrigger RoutedEvent="Window.Loaded"&gt;
          &lt;BeginStoryboard&gt;
              &lt;Storyboard&gt;
                  &lt;DoubleAnimation
          Storyboard.TargetName="mainWindow" 
          Storyboard.TargetProperty="Left"
          From="-200" To="500" Duration="0:0:1" /&gt;
              &lt;/Storyboard&gt;
          &lt;/BeginStoryboard&gt;
      &lt;/EventTrigger&gt;
  &lt;/Window.Triggers&gt;
  </code></pre>