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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:04:13+00:00 2026-06-14T07:04:13+00:00

Suppose I have 2 VM classes that implement INotifyPropertyChanged (or Prism NotificationObject in this

  • 0

Suppose I have 2 VM classes that implement INotifyPropertyChanged (or Prism NotificationObject in this case) and I want one VM to respond to a property changing in the other VM?

Suppose these are both child VMs as properties on a parent VM, what are some ways I could wire them up from the parent VM without using event aggregator / mediator?

I plan to have an ICommand (a PRISM DelegateCommand) exposed by the listening VM wired up to the PropertyChanged event of the other VM, via the parent VM.

Firstly, is this an acceptable way to do it and secondly, how do I wire-up an ICommand to an event? Do I have to use an attached behavior eg programmatic EventToCommand or similar or is there a more straight-forward way to do it?

Secondly, is this an acceptable way to do this, within the philosophy of MVVM?

  • 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-06-14T07:04:14+00:00Added an answer on June 14, 2026 at 7:04 am

    It’s more straight-forward — since your event listener has full access to the target class, you can invoke the method/command directly.

    sourceVM.PropertyChanged += (sender, args) => {
        if (args.PropertyName.Equals("Property to listen for"))
        {
            targetVM.Method();
        }
    };
    

    Or, if the target needs to be an ICommand and not a regular method, then use targetVM.Command.Execute(null); instead.

    I would also suggest creating a custom event in your source class, so that you’re not relying on OnPropertyChanged and the property name “magic string”.


    As far as the philosophy of MVVM and good design, I think it does deviate somewhat, because now your two view models are more tightly coupled. That’s not to say the approach is bad necessarily, but it does seem like Prism’s event aggregator might be a better choice.

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

Sidebar

Related Questions

I have two classes that each implement an interface. One of the classes contains
Let's suppose I have an interface named Controller. Several classes implement this interface and
If we suppose that we have this hierarchy of classes: A <- B <-
Suppose I have two classes that both contain a static variable, XmlTag. The second
Suppose I have a class Baz that inherits from classes Foo and Bar ,
If I have interface IFoo, and have several classes that implement it, what is
Suppose we have two classes: class Base { private: int x; public: void f();
suppose you have two (or more) classes with private member vectors: class A {
Suppose I have several services represented by classes ServiceA, ServiceB, ServiceC etc. These services
Suppose you have a Java class hierarchy of about 30 classes, with a base

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.