Navigate between screens in WPF
This should be a very basic design question, but for some reason it doesn't seem to be well documented (maybe due to its simplicity?).
If I'm building a dashboard application in WPF that brig up different CRM tasks and I want to navigate between screens, is this the best way to do this, or is there a better way?
So for example I have Log In Screen -> Main Menu Screen -> Screen to one of different utilities
var orderManagerWindow = new MyXamlView();
var loginWin开发者_C百科dow = Application.Current.MainWindow;
orderManagerWindow.Left = loginWindow.Left;
orderManagerWindow.Top = loginWindow.Top;
Application.Current.MainWindow = orderManagerWindow;
orderManagerWindow.Show();
loginWindow.Close();
I would really appreciate help and suggestions!
You can use a NavigationWindow
or a Frame
to display various "pages" (instances of Page
or UserControl
)
The ViewModel sample application of the WPF Application Framework (WAF) shows how a wizard can be implemented. A controller is responsible to navigate between the wizard pages. You might find it helpful.
精彩评论