Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is causing my animation to flicker
    primarykey
    data
    text
    <p>I'm doing a simple animation that works as expected until i put a border around my grid. As soon as i do this then the animation flickers when i mouse click the frame. I'm trying to achieve a menu that "slides" into view. I have included my code below. Its almost like somehow my mouse click is causing an infinite animation loop.</p> <pre><code>&lt;Border BorderBrush="YellowGreen" CornerRadius="8" BorderThickness="10" Background="Black"&gt; &lt;Grid MouseLeftButtonDown="DragWindow"&gt; &lt;Grid.Resources&gt; &lt;Style TargetType="Frame" x:Key="GrowingFrameStyle"&gt; &lt;Setter Property="Foreground" Value="#505050"/&gt; &lt;Setter Property="Background" Value="Black" /&gt; &lt;Setter Property="Height" Value="20" /&gt; &lt;Style.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Trigger.EnterActions&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Foreground.Color" To="LightGray" /&gt; &lt;ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Background.Color" To="SteelBlue" /&gt; &lt;DoubleAnimation Storyboard.TargetProperty="Height" From="20" To="50" Duration="0:0:.3" /&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/Trigger.EnterActions&gt; &lt;Trigger.ExitActions&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Foreground.Color" To="#505050" /&gt; &lt;ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Background.Color" To="Black" /&gt; &lt;DoubleAnimation Storyboard.TargetProperty="Height" From="50" To="20" Duration="0:0:.3" /&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/Trigger.ExitActions&gt; &lt;/Trigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/Grid.Resources&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;ColumnDefinition Width="50"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="20"/&gt; &lt;RowDefinition Height="*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Label Grid.Row="1" Grid.ColumnSpan="2" Background="Black"/&gt; &lt;Frame Grid.RowSpan="2" Grid.ColumnSpan="2" Background="SlateBlue" VerticalAlignment="Top" Style="{StaticResource GrowingFrameStyle}"/&gt; &lt;/Grid&gt; &lt;/Border&gt; </code></pre> <p>Only method in the code behind</p> <pre><code>private void DragWindow(object sender, System.Windows.Input.MouseButtonEventArgs e) { DragMove(); } </code></pre>
    singulars
    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.
 

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