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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:49:26+00:00 2026-05-28T04:49:26+00:00

I have a UI with nested WPF UserControls each with their own view models.

  • 0

I have a UI with nested WPF UserControls each with their own view models. A simple case of the view (XAML) hierarchy would be:

MainWindow
    |-> Logical group
      |-> Logical control
    |-> Second logical group
    |-> Third logical group
      |-> Logical control

Each XAML view has a ViewModel which encapsulates the interaction logic. My questions is about communicating ViewModel state from a parent view model to the child view models.

For example, a user interaction in the MainWindow could set a CurrentlySelectedGroup variable in the MainWindowViewModel. I need to know what that value is inside of the LogicalControlViewModel.

There are two main ways I’m considering to do this. First, I could broadcast an event DispatchGroupSelected and then assign a delegate inside LogicalControlViewModel as a listener to that event. Second, I could Bind to the CurrentlySelectedGroup property of MainWindowViewModel inside of LogicalControlViewModel.

My first instinct is to use events to communicate between parent and child view models. I think binding is best kept between a View Model and its View. Events up until now have been used to communicate between my ViewModel and Commands. If there is another possible direction to take that would be better I’d be interested to hear about it.

  • 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-28T04:49:26+00:00Added an answer on May 28, 2026 at 4:49 am

    Have you tryed with a message bus?? there are several frameworks out there that implements this pattern:

    • PRISM, have it’s EventAggregator where you can define a contract and then send and receive notifications following it.
    • MVVM Light, also have a MessageBus you can lear about it here.
    • RectiveUI, this is my favorite, it combines the power of the Reactive Extensions Observable with the Message Bus pattern, some documentation can be found here.

    Using this pattern your ViewModels can comunicate with the others in a loosely coupled way, because every ViewModel just sends a message and don’t care who is going to listen for it. And if a ViewModel wants to listen for a specific message type it can subscribe to get only those messages.

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

Sidebar

Related Questions

I have nested repeaters and checkbox in each row(like a tree view or ctaegory
I'm using VS2008 SP1 with the WPFToolKit v3.5.50211.1. I have nested WPF UserControls in
I have nested xsl:for loops: <xsl:for-each select=/Root/A> <xsl:for-each select=/Root/B> <!-- Code --> </xsl:for> </xsl:for>
I keep finding that if I have nested divs inside each other, and one
I have nested subdirectories containing html files. For each of these html files I
I have a WPF UserControl nested inside an ElementHost in a WinForm UserControl intended
I have nested grids in my views and would like to use same CSS
I have the following xaml which resides in a wpf user control - <Grid>
I have nested tabs in jquery tabs which are pretty simple to do if
I have nested repeater. And in child repeater there is a dropdownlist for each

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.