Question

My scenario:

  • I have a "Shell" ViewModel
  • In the Shell, I have a ContentControl that loads / navigates another ViewModel
  • I have an Area at the bottom of the shell where I need to add some controls (different per ViewModel)
  • I am Using ViewModel first approach
  • I am NOT using PRISM

    Scenario Image Here

My ViewModel has buttons (add, edit, delete... the usual) which works fine. I need to move these buttons into that bottom section (as in the image).

Problem is, the buttons will be out of scope of my ViewModel since they're moving into the Shell.

Idea that I had:

  • Bind the bottom section to a Custom class. Then on each view, set the DataTemplate of this custom class with all it's controls

I tried this, but it seems that the new DataTemplate on a view never gets reflected.

Any ideas on the DataTemplates can work? Or How can I define different controls in the bottom section per ViewModel, but the events they fire must be inscope of my current ViewModel?

Thanks in advance.

Was it helpful?

Solution

My solution eventually was to simply put the "commands section" within the view model at the bottom instead of in the Shell view model

See the New Layout

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top