title: XAML Storyboarding - Setting a bool to "False" in a storyboard locks it as false
body: <p>this is a somewhat odd one.
  I'm looking to use XAML to get an expander <em>(or anything with checked and unchecked states such as a Togglebutton and the like)</em> to set itself back to being collapsed/unchecked after being 'ignored' (for lack of a better term) after a given period of time.</p>
  
  <p><em>Currently</em> the parameters I'm using to decide if it's being 'ignored' are that 
  <strong>MouseOver=False</strong> and <strong>IsExpanded=True</strong>, when this trigger is raised, it'll begin a storyboard that, after about 3 seconds will set "IsExpanded" to "False".</p>
  
  <p>Which is working just fine.</p>
  
  <p>The problem is when you then want to RE-expand the expander - you can't, because the storyboard appears to be <strong>holding</strong> it as False.</p>
  
  <p>I'm probably just doing something dumb/not considering some angle of this, but it's incredibly frustrating.
  If it should turn out that it can't be done with XAML alone then that's okay, but i would prefer a purely XAML solution <em>if</em> one exists.</p>
  
  <p>To better illustrate the issue, i've made a sample project you can look at that can be downloaded     <a href="https://www.dropbox.com/s/w0tj944jejs8u6v/SelfUnchecking%20Example.rar?dl=0" rel="nofollow">Here.</a></p>
  
  <p>Alternatively, here's the code to view:</p>
  
  <pre><code>&lt;Window.Resources&gt;
          &lt;Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}"&gt;
              &lt;Style.Resources&gt;
                  &lt;Storyboard x:Key="ExpanderSelfCollapseStoryboard"&gt;
                      &lt;BooleanAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(Expander.IsExpanded)"&gt;
                          &lt;DiscreteBooleanKeyFrame KeyTime="0:0:3" Value="False" /&gt;
                      &lt;/BooleanAnimationUsingKeyFrames&gt;
                      &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="{x:Null}"&gt;
                          &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Not long..."/&gt;
                          &lt;DiscreteObjectKeyFrame KeyTime="0:0:3" Value="Notice you can't open the expander anymore :("/&gt;
                      &lt;/ObjectAnimationUsingKeyFrames&gt;
                  &lt;/Storyboard&gt;
              &lt;/Style.Resources&gt;
              &lt;Style.Triggers&gt;
                  &lt;MultiTrigger&gt;
                      &lt;MultiTrigger.EnterActions&gt;
                          &lt;BeginStoryboard x:Name="ExpanderSelfCollapseStoryboard_BeginStoryboard" Storyboard="{StaticResource ExpanderSelfCollapseStoryboard}" /&gt;
                      &lt;/MultiTrigger.EnterActions&gt;
                      &lt;MultiTrigger.Conditions&gt;
                          &lt;Condition Property="IsExpanded" Value="True" /&gt;
                          &lt;Condition Property="IsMouseOver" Value="False" /&gt;
                      &lt;/MultiTrigger.Conditions&gt;
                  &lt;/MultiTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/Window.Resources&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Expander x:Name="localExpander"
                    Background="DodgerBlue"
                    Header="Expand me!"
                    Style="{StaticResource ExpanderStyle}"
                    Tag="Up there!"&gt;
              &lt;Border Height="200"
                      Margin="5"
                      Background="Orange"&gt;
                  &lt;TextBlock HorizontalAlignment="Center"
                             VerticalAlignment="Center"
                             FontSize="20"
                             FontWeight="Bold"
                             Foreground="White"
                             Text="Now move your mouse over the whitespace for a few seconds please."
                             TextAlignment="Center"
                             TextWrapping="Wrap" /&gt;
              &lt;/Border&gt;
          &lt;/Expander&gt;
          &lt;TextBlock Grid.Row="1"
                     VerticalAlignment="Center"
                     FontSize="22"
                     Foreground="LightGray"
                     Text="{Binding ElementName=localExpander,
                                    Path=Tag}"
                     TextAlignment="Center" /&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>I'd be thankful for any help or advice anyone can render.</p>
  
  <p>Thanks,</p>
  
  <p>-- Logan</p>