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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:36:59+00:00 2026-05-14T15:36:59+00:00

The XAML {Binding} construct is very handy because it handles all of the PropertyChanged

  • 0

The XAML {Binding} construct is very handy because it handles all of the PropertyChanged issues automatically. It is really impressive when you hand it a path to an object, through .NET data structures, and everything is automatically updated for you.

I would like to use the same thing in C#. I would like to have a property that is derived from the value of another property. Example

class Foo
{
    public Bar Bar = new Bar();
    public string ItGetter
    {
        get
        {
            return Bar.Baz.It;
        }
    }
}

class Bar
{
    public Baz Baz = new Baz();
}

class Baz
{
    public string It { get { return "You got It!"; } }
}

If you call ItGetter on a Foo, you get the It value from Baz. This works fine, except that it is not invalidated–i.e., if It changed, there would be no change notifications on the ItGetter. Furthermore, if the Foo.Bar or Bar.Baz references are changed, you would also not get change noficiations.

I can add the appropriate IChangeNotify code on the properties, but my question is: How do I code the ItGetter property such that it will call its PropertyChanged event when any of the references in the path, or the It value change? I’m hoping I don’t have to manually setup property changed events on all the items in the path….

Thanks for any help!

Eric

  • 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-14T15:36:59+00:00Added an answer on May 14, 2026 at 3:36 pm

    You could take a look at dependancy properties. They allow you to define properties in the WPF property system that are backed with stacks of metadata and a detailed value resolution system.

    Importantly for you they allow they allow you to register for property changed events, and they allow you to make values dependant on other stuff.

    There are some other good artcile around such as ‘Demystifying dependency properties’ by Josh Smith and ‘Dependency Properties’ by Christian Mosers

    You might also want to read Dependency Property Callbacks and Validation

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

Sidebar

Related Questions

this is my xaml: <ListView Name=myListView ItemsSource={Binding ElementName=IndexPage, Path=SeriesCollection} ScrollViewer.HorizontalScrollBarVisibility=Disabled IsSynchronizedWithCurrentItem=True SelectionChanged=handleSelected> <ListView.ItemsPanel >
So here is the XAML that I have: <ItemsControl ItemsSource={Binding Path=Groups} ItemTemplateSelector={Binding RelativeSource={RelativeSource AncestorType=Window},
i have this construct to questionate my xml-document with a binding in xaml. XPath=/doc/B/lists/entry[@value=(/doc/A/selectedValue)]
Here is my ComboBox instantiated in the XAML <Combobox ItemsSource={Binding Path=Delimiters} DisplayMemberPath=Key SelectedValue={Binding Path=SelectedDelimiter,
I have this construct in my xaml. <Type1 visibility={binding bool1, converter=BoolToVisibilityConverter}/> <Type1 visibility={binding bool2,
WinJS allows you to bind HTML properties dynamically at run-time, similar to XAML binding.
The following XAML produces a run-time Binding error when I click on an item
xaml side: <DataGrid Name=MyGrid ItemsSource={Binding} /> I tried also with: <DataGrid Name=MyGrid ItemsSource={Binding MyObj}
I have a .xaml file and a .cs file that share value with Binding.
Here's my xaml <Button x:Name=btnTest Width=88 Content={Binding Value, ElementName=slSlider} Height={Binding Value, ElementName=slSlider} HorizontalAlignment=Left ></Button>

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.