Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Navigation using Xamarin Forms and MVVM

$
0
0

I am new to Xamarin development and I am trying to implement the MVVM design pattern. When a button is clicked, I am running a command to login. If login is successful, I want to show the next page. However, I'm not sure how to do this without violating the MVVM pattern.

I have searched and seen lots of posts related, and many people just recommend passing in the INavigation to the ViewModel and do the PushAsync call from there. This seems like it violates the pattern to me since the ViewModel shouldn't know anything about the view layer.

Surprisingly, I haven't found any official docs yet that describe the best practice for this. Can anyone suggest the best way to navigate using ViewModels and MVVM?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>