Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From <a href="http://msdn.microsoft.com/en-us/library/aa970493.aspx" rel="nofollow">MSDN</a>:</p> <blockquote> <p>In some cases, it might appear that you can't change the value of a property after it has been animated.</p> </blockquote> <p>You can solve this by adding new <code>Storyboards</code> to change <code>Width</code> property:</p> <pre><code>&lt;Style x:Key="WowButton" TargetType="Button" &gt; &lt;Style.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Setter Property="FontSize" Value="30"&gt;&lt;/Setter&gt; &lt;Setter Property="FontWeight" Value="Bold"&gt;&lt;/Setter&gt; &lt;/Trigger&gt; &lt;Trigger Property="IsMouseOver" Value="False"&gt; &lt;Setter Property="Background" Value="Yellow"&gt;&lt;/Setter&gt; &lt;Setter Property="Width" Value="150"&gt;&lt;/Setter&gt; &lt;Setter Property="FontSize" Value="25"&gt;&lt;/Setter&gt; &lt;/Trigger&gt; &lt;EventTrigger RoutedEvent="Click"&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Duration="0:0:0.25" Storyboard.TargetProperty="Width" From="300" To="500 "&gt; &lt;/DoubleAnimation&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/EventTrigger&gt; &lt;EventTrigger RoutedEvent="UIElement.MouseEnter"&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Duration="0:0:0" Storyboard.TargetProperty="Width" From="150" To="300"/&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/EventTrigger&gt; &lt;EventTrigger RoutedEvent="MouseLeave"&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Duration="0:0:2" Storyboard.TargetProperty="(Button.RenderTransform).(RotateTransform.Angle)" From="0" To="360" RepeatBehavior="1x"&gt; &lt;/DoubleAnimation&gt; &lt;DoubleAnimation Duration="0:0:0" Storyboard.TargetProperty="Width" From="300" To="150 "/&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/EventTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload