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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:40:21+00:00 2026-05-15T21:40:21+00:00

I’ve run into a problem where the TargetUpdated event seemed like it would be

  • 0

I’ve run into a problem where the TargetUpdated event seemed like it would be perfect. Unfortunately it looks like Multibinding does not have a TargetUpdated property. Is there some way to still set this up or do I need to find another solution entirely.

Heres some code to help

Heres the binding…

<RotateTransform x:Name="LeftNeedle">
<RotateTransform.Angle>
    <MultiBinding Converter="{StaticResource VoltageRatioConverter}" NotifyOnTargetUpdated="True" >
        <Binding ElementName="root" Path="Running" />
        <Binding ElementName="root" Path="Incoming" />
    </MultiBinding>
</RotateTransform.Angle>

Then I have the value converter…

public class VoltageRatioConverter : IMultiValueConverter
{
    #region IMultiValueConverter Members

    public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        if (values == null || values.Count((x) => x != null) != 2)
            return 0.0;

        double running = System.Convert.ToDouble(values[0]);
        double incoming = System.Convert.ToDouble(values[1]);

        return ((running / incoming) - 1);
    }

    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }

    #endregion
}

And what I’m looking to do is retrieve that resulting number and pass it to a function to update the angle/animation

    private static void OnAngleValueChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
    {
        GaugeCluster gauge = o as GaugeCluster;
        if ((double)e.NewValue > 70)
        {
            VisualStateManager.GoToState(gauge, "RightWobble", false);
        }
        else if ((double)e.NewValue < -70)
        {
            VisualStateManager.GoToState(gauge, "LeftWobble", false);
        }
        else
        {
            if ((double)e.OldValue > 70 || (double)e.OldValue < -70)
            {
                VisualStateManager.GoToState(gauge, "StandingState", false);
            }
        }
    }

^ This function I was just testing to make sure that it actually worked by making it a callback from one of the two dependency properties. Ideally the function body is what I want to use on the TargetUpdated event.

  • 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-15T21:40:22+00:00Added an answer on May 15, 2026 at 9:40 pm

    TargetUpdated is an attached event. You register for this event on the binding target, not the binding itself :

    <RotateTransform x:Name="LeftNeedle" Binding.TargetUpdated="LeftNeedle_TargetUpdated">
        <RotateTransform.Angle>
            <MultiBinding Converter="{StaticResource VoltageRatioConverter}" NotifyOnTargetUpdated="True" >
                <Binding ElementName="root" Path="Running" />
                <Binding ElementName="root" Path="Incoming" />
            </MultiBinding>
        </RotateTransform.Angle>
    </RotateTransform>
    

    UPDATE: Actually the solution above doesn’t work because RotateTransform is not a UIElement… You need to handle the Binding.TargetUpdated event on the UIElement to which it is applied :

    <Rectangle Fill="Blue" Width="30" Height="30"
               Binding.TargetUpdated="LeftNeedle_TargetUpdated">
      <Rectangle.RenderTransform>
        <RotateTransform x:Name="LeftNeedle">
            <RotateTransform.Angle>
                <MultiBinding Converter="{StaticResource VoltageRatioConverter}" NotifyOnTargetUpdated="True" >
                    <Binding ElementName="root" Path="Running" />
                    <Binding ElementName="root" Path="Incoming" />
                </MultiBinding>
            </RotateTransform.Angle>
        </RotateTransform>
      </Rectangle.RenderTransform>
    </Rectangle />
    

    The event will bubble up to the Rectangle, and you can check the TargetObject property of the event args to check if it is the rotation

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

Sidebar

Related Questions

I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
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
I have a French site that I want to parse, but am running into

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.