Xamarin Forms MVVM with custom controls (content view)

GaganSinghGaganSingh USUniversity ✭✭✭

What is the common flow and architecture of a Xamarin Forms app that uses MVVM Light with custom controls (content views)?
Im using LoginViewModel and LoginPage.cs that are referencing each other and in the custom control LoginView.cs its binding context is set to LoginViewModel.

My issue is that i need to reference an entry from the LoginView.xaml inside the LoginPage.cs.

Best Answer

Answers

  • GaganSinghGaganSingh USUniversity ✭✭✭

    anybody?

  • GaganSinghGaganSingh USUniversity ✭✭✭

    That works! i agree, i ended up consolidating the LoginView into the LoginPage. There was just too much spaghetti code everywhere.
    Only reason i was asking was because i wanted to segregate the UI because it was getting too big. I also wanted to make use of the LoginViewModel. And throw all of the button clicks and navigation in there.

  • NMackayNMackay GBInsider, University mod

    @GaganSingh

    I do the same, there's very little code behind, just view specific stuff like cleanup. Using MVVM Light as well :smile:

Sign In or Register to comment.