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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:09:16+00:00 2026-05-22T15:09:16+00:00

My Model implements INotifyPropertyChanged , and I have a WPF window bound to it

  • 0

My Model implements INotifyPropertyChanged, and I have a WPF window bound to it (two way bindings).

I need to know when the model is being changed through the bound UI, so I could call an Update method from another module (which then copies My model to it’s internal structures).
Model can also be changed by another module.

How to tell (in my PropertyChanged event handler) if the change originated in my UI, and not in that other module?

I do not want to call Update method if it was the other module that triggered the PropertyChanged 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-22T15:09:17+00:00Added an answer on May 22, 2026 at 3:09 pm

    I’m fairly new to WPF myself, but the only immediately obvious way I can think of to do this would be to add extra set methods to the model, that modify the backing store without directly changing the property and thus firing the PropertyChanged event. To remove duplication, the property setter should probably call those methods as well and there should be a boolean argument fireChangedEvent. Something like this:

    public string SomeThing
    {
        get { return _someThing; }
        set { SetSomeThing(value, true); }
    }
    
    public void SetSomeThing(string value, bool fireChangedEvent)
    {
        _someThing = value;
        if(fireChangedEvent)
        {
            NotifyPropertyChanged("SomeThing");
        }
    }
    

    Then, in the other module, it would be

    public void DoStuff
    {
        // ...
        model.SetSomeThing("foo",false);
        // ...
    }
    

    It’s not an elegant method I know, and I hope someone else can think of something smarter, but I can’t think of a good way of finding out from inside a property setter what exactly is setting that property.

    Hopefully this is at least a workaround suggestion.

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

Sidebar

Related Questions

Most MVVM examples I have worked through have had the Model implement INotifyPropertyChanged ,
If my model implements INotifyPropertyChanged and does my VM need to? Clarification: In the
I'm getting confused; I thought I understood INotifyPropertyChanged. I have a small WPF app
I have a model class which implements the NSCoding protocol. I have a property
My view model implements INotifyPropertyChanged for properties that it makes available to my view.
I have a database model with two tables: Session and ScriptExecution which are associated
I'm trying to implement a WPF application using MVVM (Model-View-ViewModel) pattern and I'd like
I am trying to implement the SIR epidemic model . Basically, the way I
I have a Java project that I'm trying to implement with a model-view-controller design.
I have an object model like this: class Car { public string Manufacturer; public

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.