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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:19:18+00:00 2026-05-31T13:19:18+00:00

What determines the order that multiple DepdencyProperties on the same control get evaluated in?

  • 0

What determines the order that multiple DepdencyProperties on the same control get evaluated in?

I am using the Extended WPF Toolkit PropertyGrid and have both SelectedObject and PropertyDefinitions bound:

<extToolkit:PropertyGrid AutoGenerateProperties="False" SelectedObject="{Binding ActiveDataPoint}" PropertyDefinitions="{Binding ActiveDataPoint.Properties}">

The problem is that the OnSelectedObjectChanged fires from the dependency property, and in that changed handler it is referencing PropertyDefinitions, which it is seeing as null. If I comment out the OnSelectedObjectChanged handler then I can see when debugging that OnPropertyDefinitionsChanged is called AFTER the call to OnSelectedObjectChanged.

public static readonly DependencyProperty PropertyDefinitionsProperty = DependencyProperty.Register( "PropertyDefinitions", typeof( PropertyDefinitionCollection ), typeof( PropertyGrid ), new UIPropertyMetadata( null, OnPropertyDefinitionsChanged ) );
public PropertyDefinitionCollection PropertyDefinitions
{
  get
  {
    return ( PropertyDefinitionCollection )GetValue( PropertyDefinitionsProperty );
  }
  set
  {
    SetValue( PropertyDefinitionsProperty, value );
  }
}

private static void OnPropertyDefinitionsChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
    Console.Write("I changed!");
}

public static readonly DependencyProperty SelectedObjectProperty = DependencyProperty.Register( "SelectedObject", typeof( object ), typeof( PropertyGrid ), new UIPropertyMetadata( null, OnSelectedObjectChanged ) );
public object SelectedObject
{
  get
  {
    return ( object )GetValue( SelectedObjectProperty );
  }
  set
  {
    SetValue( SelectedObjectProperty, value );
  }
}

private static void OnSelectedObjectChanged( DependencyObject o, DependencyPropertyChangedEventArgs e )
{
  PropertyGrid propertyInspector = o as PropertyGrid;
  if( propertyInspector != null )
    propertyInspector.OnSelectedObjectChanged( ( object )e.OldValue, ( object )e.NewValue );
}

The problem I am facing is discussed on this forum thread, but I am asking a more general WPF question of how I can change the order that these properties are updated.

I have tried having multiple calls to NotifyPropertyChanged in different orders but that doesn’t seem to affect this. Can I cause the order to be different or should I just modify the PropertyGrid so that it will work for either order?

  • 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-31T13:19:18+00:00Added an answer on May 31, 2026 at 1:19 pm

    The short answer is that it is all a black box and you should not rely on one being evaluated before or after another. So the best approach would be to modify the PropertyGrid so it works regardless of the order the properties are set.

    The long answer is it looks like it depends on how the order that the bindings are specified. So you can do:

    <extToolkit:PropertyGrid AutoGenerateProperties="False"
        PropertyDefinitions="{Binding ActiveDataPoint.Properties}"
        SelectedObject="{Binding ActiveDataPoint}"
        >
    

    Instead of:

    <extToolkit:PropertyGrid AutoGenerateProperties="False"
        SelectedObject="{Binding ActiveDataPoint}"
        PropertyDefinitions="{Binding ActiveDataPoint.Properties}"
        >
    

    Again, it would be bad practice to rely on this. And this quirk may only work for when the control is initialized. Changes to ActiveDataPoint or the DataContext later, may result in a different order.

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

Sidebar

Related Questions

Is there a rule in CSS that determines the cascading order when multiple classes
I have a Control that can overlay multiple C# user controls in my GUI.
We have a series of drop down controls that determine the sort order of
I have a program (a fractal) that draws lines in an interlaced order. Originally,
i'm using Orbeon section templates in a common library that i use in multiple
If I make multiple HTTP Get Requests to the same server and get HTTP
In order to determine what low-level framework types a web application is directly using,
I'm using an if statement in order to determine if an element has any
I'm using: FileInfo( System.Environment.GetFolderPath( System.Environment.SpecialFolder.ProgramFiles) + @\MyInstalledApp In order to determine if a program
I am creating a class that determines which of number of registered WCF client

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.