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

  • Home
  • SEARCH
  • 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 281421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:12:06+00:00 2026-05-12T05:12:06+00:00

This is a situation that comes up often: In the View, you have a

  • 0

This is a situation that comes up often:

In the View, you have a control bound to a ViewModel property (backed by a INotifyPropertyChanged). For example:

<TextBlock Text="{Binding Path=Subtotal}"/>

When the property changes, you need to bring the user attention to the fact with some creative animation. How I can utilize the fact that the view is already wired to the notification and avoid creating much of the extra code (or at least create it once and re-use). Data triggers are probably the best choice, but I do not know how to make them fire on any value change versus on some specific value.

The following options come to mind:

  • raise an additional event in the ViewModel, subscribe in the View code-behind.
  • create a datatrigger bound to the property mentioned using a convertor that would return true if the value is changing.
  • create a datatrigger bound to a new boolean property on the ViewModel which is used to “signal” the change.
  • create a behavior attached to the control which would subscribe to the control’s dependency property change and start the animation.

Which one do you like/use? Did I miss any options?

P.S. It would be nice (but not critical) if the solution would provide a possibility to start the animation first and reflect the value change when it is ended.

  • 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-12T05:12:06+00:00Added an answer on May 12, 2026 at 5:12 am

    Ok, this is what I came to after some experimenting.

    I have created an Expression Blend 3 trigger with a dependency property (I named it Subscription). I bind the Subscription to the same value that my TextBlock is bound to and this trigger is attached to a ControlStoryboardAction from Expression Blend 3.

    Here’s the trigger:

    public class DataTriggerPlus : TriggerBase<DependencyObject>
    {
        public static readonly DependencyProperty SubscriptionProperty =
            DependencyProperty.Register("Subscription", 
                typeof(string),
                typeof(DataTriggerPlus),
                new FrameworkPropertyMetadata("",
                  new PropertyChangedCallback(OnSubscriptionChanged)));
    
        public string Subscription
        {
            get { return (string)GetValue(SubscriptionProperty); }
            set { SetValue(SubscriptionProperty, value); }
        }
    
        private static void OnSubscriptionChanged(DependencyObject d,
          DependencyPropertyChangedEventArgs e)
        {
            ((DataTriggerPlus)d).InvokeActions(null);
        }
    }
    

    Here’s how it is attached to the storyboard:

    <TextBlock x:Name="textBlock" Text="{Binding TestProp}" Background="White">
        <i:Interaction.Triggers>
            <local:DataTriggerPlus Subscription="{Binding TestProp}">
                <im:ControlStoryboardAction 
                    Storyboard="{StaticResource Storyboard1}"/>
            </local:DataTriggerPlus>
        </i:Interaction.Triggers>
    </TextBlock>
    

    I like this approach a lot, great job Blend 3 designers!

    Edit: answering Drew comment…

    Yes, it ships with Blend. You can just include Microsoft.Expression.Interactions.dll and System.Windows.Interactivity into your project.

    And yes, it is verbose (I have asked if somebody figured out a good way to apply behaviours via Styles in this question) – but there is also a benefit of flexibility. For example you can not only start a storyboard, but also switch a state or do some other action from the same trigger.

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

Sidebar

Related Questions

The situation is this: You have a Hibernate context with an object graph that
The Situation (Ignore this it is boring): I have reports that I created using
This is the situation. I have a windows form app that uses an access
A situation I ran across this week: we have a jQuery Ajax call that
Here is the situation. I have some javascript that looks like this: function onSubmit()
This sort of situation comes up pretty often. You loop through an array, and
Here's a situation that comes up quite often that never sits too easy with
G'day, Edit: While this question covers a situation that can arise in programming a
In this particular situation, there are 9 automated steps in a process that take
Is this possible? Situation is that I want to store some XML in my

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.