Does anyone have an idea how to change screens (views) in MVVM View-First-Approach (the view creates an instance of ViewModel:
DataContext="{Binding Source={StaticResource VMLocator}, Path=Find[EntranceViewModel]}"
)
For example: In my MainWindow (Shell), I show the input view with the "GoToBeach" button.
<Window> <DockPanel> <TextBox DockPanel.Dock="Top" Text="{Binding Title}" /> <view.EntranceView DockPanel.Dock="Top" /> </DockPanel> </Window>
When the button is pressed, I want to get rid of "EntranceView" and show "BeachView". I'm really curious if someone knows a way to keep the “First Look” approach and change the screen (view) to “BeachView”. I know that there are several ways to implement it in the first approach to ViewModel, but this is not a question. Perkhubs, I missed something in my mvvm study and don't see a tree for trees ... otherwise I'm hoping for an inspiring discussion.
source share