Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7547291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:24:56+00:00 2026-05-30T09:24:56+00:00

I’m doing a simple animation that works as expected until i put a border

  • 0

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.

<Border  BorderBrush="YellowGreen" CornerRadius="8" BorderThickness="10" Background="Black">
        <Grid MouseLeftButtonDown="DragWindow">
            <Grid.Resources>
                    <Style TargetType="Frame" x:Key="GrowingFrameStyle">
                        <Setter Property="Foreground" Value="#505050"/>
                        <Setter Property="Background" Value="Black" />
                        <Setter Property="Height" Value="20" />
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Foreground.Color" To="LightGray" />
                                            <ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Background.Color" To="SteelBlue" />
                                            <DoubleAnimation Storyboard.TargetProperty="Height" From="20" To="50" Duration="0:0:.3" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                                <Trigger.ExitActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Foreground.Color" To="#505050" />
                                            <ColorAnimation Duration="0:0:0.5" Storyboard.TargetProperty="Background.Color" To="Black" />
                                            <DoubleAnimation Storyboard.TargetProperty="Height" From="50" To="20" Duration="0:0:.3" />
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.ExitActions>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="50"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="20"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Label Grid.Row="1" Grid.ColumnSpan="2" Background="Black"/>
            <Frame Grid.RowSpan="2" Grid.ColumnSpan="2" Background="SlateBlue" VerticalAlignment="Top" Style="{StaticResource GrowingFrameStyle}"/>        
        </Grid>
    </Border>

Only method in the code behind

private void DragWindow(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
  DragMove();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:24:57+00:00Added an answer on May 30, 2026 at 9:24 am

    It’s caused by clicking on an expanded area of the Frame.

    The MouseUp event seems to be firing a MouseLeave/MouseEnter event. The MouseLeave is trigging the animation to shrink the frame, which queues a Shrink storyboard event, and the MouseEnter is queuing the animation to expand the frame, which queues an Expand storyboard event. By shrinking/expanding the frame, the MouseEnter/MouseLeave get fired again and the animations both get run again. These two keep firing endlessly until you move the mouse out of the magical area that is only occupied when the Frame is expanded.

    You can view the delay in slow-motion by adding BeginTime="00:00:02" to your Storyboards to add a 2-second delay, and you can verify the MouseEnter/MouseLeave events by attaching a method which writes a line to output in the MouseEnter/MouseLeave events of the Frame.

    As for fixing it, I’m not sure the best way to do that. Perhaps try using the MouseEnter/MouseLeave events to trigger the events manually after a 1-second delay providing the event should still process.

    For example, if the MouseUp event triggers MouseLeave and MouseEnter events, then the MouseLeave should queue the collapse animation, but delay a second and check if the Mouse is actually over the object a second later. If not, cancel the collapse event. This would cause the MouseLeave event not to fire its animation, which means it won’t queue animations endlessly until the mouse is moved off the expanded Frame’s area.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am doing a simple coin flipping experiment for class that involves flipping a
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.