2

I need to develop an multipage WPF application. I tried to achieve that by using one Window and multiple Pages. When I need to switch from one to another page I just change Content of main Window to point to that page. I have filling that I'm using wrong scenario because I don't have idea how to reuse XAML code for example an Menu controll, StatusBar and ToolBar for all pages.

Borko Djurovic
  • 313
  • 2
  • 17

2 Answers2

2

You need ContentControl. It changes view based on ViewModel. Place your static elements in one place and in changeable area a ContenControl object. More here and here.

Community
  • 1
  • 1
Maximus
  • 3,458
  • 3
  • 16
  • 27
0

One idea is you have a PageViewModelBase that implement a base virtual Property and Methods for Menu and StatusBar model and ... Then Each PageViewModel Override proper implementation of PageViewModelBase, Then Window contains Menu or StatusBar that Bind to DataContext of Pages.

Reza ArabQaeni
  • 4,848
  • 27
  • 46