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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:13:29+00:00 2026-05-23T09:13:29+00:00

This project is in c# under .net 4. I have a custom object that

  • 0

This project is in c# under .net 4.

I have a custom object that changes value every so often. A UI control should reflect the latest state – so I’m trying to use bindings, but I can’t get it hooked up.

I want the control to notice when the value of the object changes (binding?), and then animate (Storyboard?) to the new value over 1/2 s or so. It’s direction-specific, so if the old value was 340degrees, and the new is 15 degrees, I don’t want it to rotate around the ‘long way’, so would need some logic for the animation somewhere.

Ideally, all of this animation detail should be in the UI (xaml) – my object that gets updated doesn’t want to know about UI details. The tools in Blend4 don’t seem up to the job, and my hacking around in xaml is going nowhere very slowly…

Should I have another object that listens for the changes to my source object and then configures the animation every time? Should it be all in xaml? ‘Real’ code?

Does anyone know the right approach to take, here? Or can point to someone having blogged something pretty similar? I’ve been on this for two days, now!

  • 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-23T09:13:30+00:00Added an answer on May 23, 2026 at 9:13 am

    After going back and forth with respect to responsibility for animation, fear of designers stuffing up code in blend, and actually getting it working, I’ve (provisionally) arrived on a solution of sorts…

    this is called in MainWindow.xaml.cs on startup:

    private void initialiseCustomAnimations()
    {
    
        compassRoseAnimation = new DoubleAnimation();
        compassRoseAnimation.Duration = new Duration(TimeSpan.FromSeconds(2));
        navigationData.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(navigationData_PropertyChanged);
    
    }
    

    and this is the guts (where CompassWithNumbersControl is a canvas built in blend):

    private void navigationData_PropertyChanged(object sender, EventArgs e)
    {
        compassRoseAnimation.From = navigationData.previousHeading;
        compassRoseAnimation.To = navigationData.heading;
        RotateTransform rotateTransform = new RotateTransform();
        CompassWithNumbersControl.RenderTransform = rotateTransform;
        rotateTransform.BeginAnimation(RotateTransform.AngleProperty, compassRoseAnimation);
    }
    

    I should only perform this animation on the correct event getting fired, but it works..

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

Sidebar

Related Questions

I'm using .net 2.0. This is a project that I have taken over for
I have added this jar file to my project's build path under libraries: http://sunet.dl.sourceforge.net/project/jeplite/jeplite/jeplite-0.8.7/jeplite-0.8.7a-src.jar
I have an ASP.NET project under development with my team. and I want to
I have a .NET project (VS2008 .NET 3.5) that builds an exe. I have
I have something like this in Site.Master in an asp.net mvc3 (not razor) project:
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
Short version: I have an MSBuild project that imports another project. There is a
I have a project that currently compiles happily on my dev machine using VS
I have a vs.net project, and after some refactoring, have modified the name of
I have an asp.net MVC project hosting a silverlight application. I just started rebuilding

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.