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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:50:12+00:00 2026-05-24T12:50:12+00:00

I have an entity like this: public class Person { public string Name {

  • 0

I have an entity like this:

public class Person
{
    public string Name { get; set; }

    public Person()
    {
        Name = "Godspeed";
    }
}

Then I have three textbox and a button in XAML:

<Window x:Class="WpfApplication19.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:WpfApplication19"
        Title="MainWindow" Height="350" Width="525">
    <Window.DataContext>
        <local:Person />
    </Window.DataContext>
    <StackPanel>
        <TextBox Text="{Binding Name,UpdateSourceTrigger=PropertyChanged}" />
        <TextBox Text="{Binding Name,UpdateSourceTrigger=PropertyChanged}" />
        <TextBox Text="{Binding Name,UpdateSourceTrigger=PropertyChanged}" />
        <Button Click="Button_Click">Click</Button>
    </StackPanel>
</Window>

The weird thing is that, the entity “Person” doesn’t implement the INotifyPropertyChanged, but when one text box is changed, it modifies the source(Person object), but we didn’t raised the property changed event but the rest two textboxes automatically changed.

When the button clicks, we update the source directly by code like:

((Person)DataContext).Name = "Godspeed";

It doesn’t update. So what I think is that if the Person class implement the INotifyPropertyChanged, this behavior is normal, but now the class doesn’t implement the interface, but it update the interface too. Please info me the reason if you have some clue. Thanks.

  • 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-24T12:50:13+00:00Added an answer on May 24, 2026 at 12:50 pm

    The reason is PropertyDescriptor, see the following thread,
    the same question is being asked: How does the data binding system know when a property is changed?

    Here is two of the answers

    I think the magic lies in the binding system’s use of
    PropertyDescriptor (SetValue presumably raises a ValueChanged – the
    PropertyDescriptor is likely shared, while the events are raised on a
    per-object basis).


    I’m not at Microsoft, but I can confirm it. If PropertyDescriptor is
    used to update the value, as it will be, then relevant change
    notifications are automatically propagated.

    Edit
    You can verify this by naming the Person DataContext object

    <Window.DataContext>
        <local:Person x:Name="person"/>
    </Window.DataContext>
    

    and add the following code to the MainWindow ctor

    public MainWindow()
    {
        InitializeComponent();
    
        PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(person);
        PropertyDescriptor nameProperty = properties[0];
        nameProperty.AddValueChanged(person, OnPropertyChanged);
    }
    void OnPropertyChanged(object sender, EventArgs e)
    {
        MessageBox.Show("Name Changed");
    }
    

    Once you change the value on any of the three TextBoxes, you’ll end up in the event handler OnPropertyChanged.

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

Sidebar

Related Questions

I have a Person and an Organisation Entity: Person looks like this: public class
i have an entity like this: public class Account{ private String code; @ManyToOne private
I have an entity Person: public class Person { public virtual int Id {get;
I have an entity that looks like this: public partial class MemberTank { public
Using NHibernate.Mapping.Attributes, I have a entity class with something like: [Class] public class EntityA
I have a simple class that provides state codes like this: public class StateProvider
I have the following entity structure: public class Party { public Int32 PartyId {
@Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class Problem { @ManyToOne private Person person; } @Entity
Say I have ViewModel class MyViewModel like: public class MyViewModel : ViewModelBase { private
I have an entity class that has a property with an underlying db column

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.