0

I have a navigation bar in place that I have borrowed from the internet https://www.youtube.com/watch?v=YQ1EJJZBHyE

enter image description here

enter image description here

When a navigation button is clicked instead of navigating to a different page, I would instead like to have the gray area populated with its own View. I would also like each of these to have its own corresponding ViewModel as well.

I would prefer to roll this on my own, without another third-party library (Currently using the simple MVVMLight). However, if the solution is really involved a third-party library is fine - i'm not trying to reinvent the wheel.

I assume I would use something similar to a UserControl in WinForms, but i'm not sure how to handle the varying size when the left navpanel is expanded or retracted.

Here is a screen shot of the relevant code:

enter image description here

Rhurac
  • 439
  • 4
  • 16
  • 1
    first of all DO NOT ADD CODE AS SCREENSHOT! Add it properly formated in you questions so we can help and edit it. To solve your issue you can put Placeholders (`Frames`) in the grid and fill the `Frames` with `Pages` hovever what you do there looks suspiciously like a tab control. Maybe just use a Tabcontrol in first place and edit its style to fit you need! – Denis Schaf Mar 06 '19 at 07:30
  • Google viewmodel first. Do not use frames and pages. All they add is overhead compared to a contentcontrol and usercontrols templated out from viewmodels. You will want to let the layout of your views flow to adapt to changing width. Minwidth on columns with data in them and some white space to either side ( like many web pages ) is an option. There's a simplistic example of viewmodel first here https://social.technet.microsoft.com/wiki/contents/articles/52485.wpf-tips-do-not-use-frame-and-page-for-navigation.aspx – Andy Mar 06 '19 at 08:52

1 Answers1

0

The answer with the most votes here very clearly illustrates a solution to what I was after, and fleshes out some of the details of the comments left here by the good gentleman assisting me.

Rhurac
  • 439
  • 4
  • 16