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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:01:10+00:00 2026-05-14T20:01:10+00:00

So how do you display complex aggregated ViewModels whose Models have relations to each

  • 0

So how do you display complex aggregated ViewModels whose Models have relations to each other?

NO wpf disciple ever spoke about that, guess why its not possible…

Do you think thats true?

Don`t understand me?

Look: A CustomerViewModel has many OrderViewModel and those many ProductViewModel.

You have 3 Workspaces to enter the new data for all 3 ViewModels AND you have 3 listboxes/combobo/datagrid to multiselect Collections of type => customerVMs, orderVMs and productVM`s.

That the UI makes sense to the user he should not need to turn off/on the workspace every new customer/order/product is added what is a bad user experience, how do you do this typical LOB application requirement?

EDIT:

You have in MVVM a Collection of type WorkSpace.
Every ViewModel can be a Workspace because it derives from WorkSpace class.
The Workspaces collection is bound to a ItemsSource afair josh smith example.

Statement: I want to use goold mature windows forms user interfaces no closable viewmodels…
Problem: MVVM can only work with workspaces (closable doesnt matter…) because a CustomerviewModel must already be instantiated and then added to the workspaces collection bound to the itemsControl and datatemplated depending on the datatype.

If I would have no Workspaces which hold my ViewModel instances I could not datatemplate them, because a ViewModel in MVVM takes a model as constructor parameter.
DataTemplating a UserControl with DataType of the CustomerViewModel will throw a Exception in XAML!

Now look at my UI I want to have: I have no workspaces but 3 ViewModels = 3 UserControls datatemplated means 3 times a big bang…

You get now why I do not like MVVM? Its not well thought and I search for a solution…

Of course I could put my ViewModels aka DataFormulars in a ObservableCollection but I do not want them to be bound to an ItemsControl. I want that these 3 UserControl have a certain position in my layout. with an ItemsControl you have a stupid queue where a new Dataformular is just added and wrapped if it doesnt fit into the existing space. Thats is all rubbish layout design/bad UI.

You get me now?

  • 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-14T20:01:11+00:00Added an answer on May 14, 2026 at 8:01 pm

    You can easily have multiple controls in a Window, each bound to a different ViewModel. To coordinate between the VMs, a typical approach is to loosely couple the different components together using message passing. For instance, your Customer ViewModel may send a message saying that you’ve selected an Order and then your OrderViewModel (visualized as a control in part of your main window, perhaps) will see the message and change the displayed Order.

    You can accomplish something similar with a shared service class that exposes an interface which you inject into each of your VMs. You can then bind the properties of this shared interface to allow the VMs to communicate, much the same way as with messages. I’ve used something similar to this to represent a “SelectedObject” concept, where a wide range of different object types could be selected and different VMs in my app have different ways they might like to visualize that. For instance, using your example, if a Product became the SelectedObject, you might have a “detail” panel that now renders the Product using some standard ProductDataTemplate and perhaps another panel (displaying the Order) would change the SelectedItem on a Products list. You can easily have multiple ‘workspaces’ and all of them stay in sync with eachother by virtue of the set of properties or messages that the VMs use to collaborate.

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

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The "hollow" or white, as I perceive it, arrow means… May 14, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer You can do this by using XMPP (formerly named Jabber).… May 14, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer Try connecting with the Dedicated Administrator Connection. That will give… May 14, 2026 at 11:32 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.