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 8316729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:25:31+00:00 2026-06-08T21:25:31+00:00

I am using Microsoft Interactivity and Microsoft Interactions to rotate an object based on

  • 0

I am using Microsoft Interactivity and Microsoft Interactions to rotate an object based on a Property in my code-behind. To make the rotation more smooth I added in an easing function. It does the animation perfectly fine but when it reaches the end of the animation for 1 split frame the rotation resets to the value it was before the animation and then switches back to the value after the rotation, causing it to ‘twitch’ back and forth. This only happens on EaseOut.

<i:Interaction.Triggers>
    <ie:PropertyChangedTrigger Binding="{Binding Rotation}">
        <ie:ChangePropertyAction TargetName="RotateTransformer" PropertyName="Angle" Value="{Binding Rotation}" Duration="0:0:2">
            <ie:ChangePropertyAction.Ease>                        
                <BackEase EasingMode="EaseOut" Amplitude="1.2" />
            </ie:ChangePropertyAction.Ease>
        </ie:ChangePropertyAction>
    </ie:PropertyChangedTrigger>
</i:Interaction.Triggers>
<Path Stroke="Black" Fill="Gray">
    <Path.RenderTransform>
        <RotateTransform x:Name="RotateTransformer" CenterX="64" CenterY="105" />
    </Path.RenderTransform>
    <Path.Data>
        <PathGeometry>
            <PathFigureCollection>
                <PathFigure StartPoint="64,0" >
                    <LineSegment Point="39,110" />
                    <LineSegment Point="64, 70" />
                    <LineSegment Point="39,180" />
                    <LineSegment Point="89, 180" />
                    <LineSegment Point="64,70"/>
                    <LineSegment Point="89,110" />
                    <LineSegment Point="64,0" />
                </PathFigure>
            </PathFigureCollection>
        </PathGeometry>
    </Path.Data>
</Path>
  • 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-06-08T21:25:32+00:00Added an answer on June 8, 2026 at 9:25 pm

    As this seems to be a bug in the implementation of the ChangePropertyAction class, I figured the best way to get to the bottom of this is to throw the assembly into your favorite reflector style app, and look at the guts of the implementation.

    Here’s an excerpt (there’s a lot left out, but the relevant bit is in there though):

      public class ChangePropertyAction : TargetedTriggerAction<object>
      {
        /* some dependency properties here, like DurationProperty, ValueProperty, etc... */
    
    
        protected override void Invoke(object parameter)
        {
           /* a lot of validation here, but skimming over that mostly. Valid input results in a call to AnimatePropertyChange() */
        }
    
        private void AnimatePropertyChange(PropertyInfo propertyInfo, object fromValue, object newValue)
        {
          Storyboard storyboard = new Storyboard();
          Timeline timeline = !typeof (double).IsAssignableFrom(propertyInfo.PropertyType) 
                    ? (!typeof (Color).IsAssignableFrom(propertyInfo.PropertyType)
                    ? (!typeof (Point).IsAssignableFrom(propertyInfo.PropertyType)
                    ? this.CreateKeyFrameAnimation(fromValue, newValue)
                        : this.CreatePointAnimation((Point) fromValue, (Point) newValue))
                        : this.CreateColorAnimation((Color) fromValue, (Color) newValue))
                        : this.CreateDoubleAnimation((double) fromValue, (double) newValue);
          timeline.Duration = this.Duration;
          storyboard.Children.Add(timeline);
          Storyboard.SetTarget((Timeline) storyboard, (DependencyObject) this.Target);
          Storyboard.SetTargetProperty((Timeline) storyboard, new PropertyPath(propertyInfo.Name, new object[0]));
          storyboard.Completed += (EventHandler) ((o, e) => propertyInfo.SetValue(this.Target, newValue, new object[0]));
          storyboard.FillBehavior = FillBehavior.Stop;
          storyboard.Begin();
        }
    
        private static object GetCurrentPropertyValue(object target, PropertyInfo propertyInfo)
        {
          FrameworkElement frameworkElement = target as FrameworkElement;
          target.GetType();
          object obj = propertyInfo.GetValue(target, (object[]) null);
          if (frameworkElement != null && (propertyInfo.Name == "Width" || propertyInfo.Name == "Height") && double.IsNaN((double) obj))
            obj = !(propertyInfo.Name == "Width") ? (object) frameworkElement.ActualHeight : (object) frameworkElement.ActualWidth;
          return obj;
        }
    
        private Timeline CreateDoubleAnimation(double fromValue, double newValue)
        {
          return (Timeline) new DoubleAnimation()
          {
            From = new double?(fromValue),
            To = new double?(newValue),
            EasingFunction = this.Ease
          };
        }
      }
    

    If you want to look at the full code, run it through DotPeek or ILSpy yourself, both are free 🙂

    So in the end, all it’s doing is validating inputs, looking at the type of the value and create a storyboard with a transition animation appropriate to the property type.
    The ‘flicker’ effect is actually the value briefly returning to its original value (that which is actually bound) when the animation is done, after which the binding is updated to reflect the new value.
    The reason for this behavior is down to one single property setting on the storyboard:

    storyboard.FillBehavior = FillBehavior.Stop;
    

    This FillBehavior determines what happens when the Timeline (the storyboard in this case) reaches its end. MSDN has this to say:

    HoldEnd: After it reaches the end of its active period, the timeline
    holds its progress until the end of its parent’s active and hold
    periods.

    Stop: The timeline stops if it is outside its active period while its
    parent is inside its active period.

    If we simply change this property to be set to FillBehavior.HoldEnd, the flicker is gone. The downside is that you’ll have to re-implement this TriggerAction, but you can probably leave out a lot if you just want it to work for a double animation.

    Hope this helps anyone!

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

Sidebar

Related Questions

I'm using Microsoft's CSharpCodeProvider to dynamically create and execute code. Right now, it creates
We have been using Microsoft Enterprise Lib for data access, some old legacy code
Ive added the using Microsoft.SharePoint.Client; But still getting errors, is it some dll i
I am using Microsoft.SqlServer.Management.Smo . My Code: Server server = new Server(new ServerConnection( new
I using Microsoft.Office.Interop.Excel I get returned a 2D array of type object[,] which contains
Using Microsoft SQL Server 2005 and above, what code do I use to validate
Considering the code below: xmlns:interactivity=clr-namespace:Microsoft.Expression.Interactivity;assembly=Microsoft.Expression.Interactivity ... <ToggleButton IsChecked={Binding Path=IsGlobalControllerAttached} Command={Binding Path=AttachDetachGlobalControllerAction} ToolTip={Binding Path=GlobalControllerToolTip} Visibility={Binding
Using Microsoft SQL Server 2005, is there any way to see when a table
Using Microsoft SQL Server... declare @x xml set @x = '<Example>&lt;You &amp; Me&gt;</Example>' select
Using: Microsoft SQL Server 2008 Microsoft Visual Studio 2010 C# .NET 4.0 WinForms Ok

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.