Creating an app, is NavigationWindow the way to go to have multiple pages?
just starting my journey with app dev and wanted to create multiple pages within my app. Is NavigationWindow the best way to go about this? I see other options such as NavigationService and Frames and just get a little confused at what way i should be going
10 Replies
i also see this tutorial here which scanning through it seems alot more complicated and different to whatever i did https://www.youtube.com/watch?v=wFzmBZpjuAo&ab_channel=Payload
Payload
YouTube
WPF Switching Views With Navigation Using MVVM And Dependency Injec...
WPF Switching Views With Navigation Using MVVM And Dependency Injection this tutorial will show you how to switch views in wpf using MVVM and dependency injection using C# the programming language and WPF the programming UI framwork in order to navigate through multiple views you can use this with multiple windows as well this is a tutorial and ...
is MVVM the way to go?
yes
UserControl serving as pages
MVVM pattern
these days a lot of the boilerplate is done using CommunityToolkit or ReactiveUI, replacing that whole bunch of INPC code.
and yes its a bit complex to get into if u dont have some experience with c# and WPF already
one thing I would advise against thou is the folder structure in both videos but that is something u can figure out later...
instead I would recommend a feature structure which makes it a lot easier to organize everything
![No description](https://cdn.answeroverflow.com/1264305001208090715/image.png)
there are essentially 2 ways to display a usercontrol, directly calling it, i.e.:
alternatively you use a
ContentControl
where not only you can swap which usercontrol to display, but you can also have it display based on a type(aka its ViewModel and have it display the control based on the VM)
in this scenario your Window, becomes a shell that will be housing all further usercontrols and controlsthanks so much for your response
ill dive into setting up the MVVM later on and so dont really have any further questions for now
but is it ok if i stumble into anything i can just shoot you a message here?
you can open a new help thread with the specific question or ask in #gui
I am sure u will have many MVVM is very peculiar in how to do things and split responsability
asking on #gui is probably preferable for MVVM questions imo as there are multiple people there that can help
as people have their different timezone and all
great then thanks so much
really appreciate your time