I got MVVM 3-Level-Master-Detail Switchting working but with CRUD operations now everything seems st

Posted by msfanboy on Stack Overflow See other posts from Stack Overflow or by msfanboy
Published on 2010-05-01T10:19:28Z Indexed on 2010/05/01 10:27 UTC
Read the original article Hit count: 685

Filed under:
|
|
|
|

Hello,

I have 1 UserControl (SchoolclassAdministration.xaml) that is datatemplated with 1 ViewModel (SchoolclassAdministrationViewModel)

I have 3 Models and 3 ViewModels in that scenario. Those 3 ViewModels must reflect the requirements of the View.

The requirements are 3 "Areas" on the left side and 2 "Areas" on the right side.

3: SchoolclassFormular PupilFormular SubjectFormular Those have all Buttons for Add/Delete

2: PupilsDataGrid SubjectsDataGrid

The Master-Detail scenario is between the:

SchoolclassFormular => PupilsDataGrid => SubjectsDataGrid

The switching of the ViewModelCollections work!

My Problem scenario is this:

The DataContext is on the SchoolclassAdministrationViewModel what is the ViewModel containing the AllSchoolclassesViewModel ObservableCollection bound to the SchoolclassAdministration.xaml UserControl.

My SchoolclassViewModel,PupilViewModel and SubjectViewModel has all Properties, Commands(Add/Delete).

My Question: How can I set these 3 ViewModels as DataContext to my ONE SchoolclassAdministration.xaml UserControl I have?

Before you answer... putting every ViewModel(schoolclass,pupil,subject) in its own UserControl will not help me because then the Master-Detail switching can NOT work anymore. Every related ViewModels need to be put in a related/ONE UserControl.

OK now I can`t wait for an answer because that scenario is driving me nuts for weeks.

© Stack Overflow or respective owner

Related posts about mvvm

Related posts about wpf