0

I need some guidance with respect to Xamarin Native Project

The Plan is:

  1. UI Development:
  • Xamarin.iOS with its independent UI - ie: UITableView / UICollectionViews, etc
  • Xamarin.Android with its independent UI - ie: Listview and Adapters / RecyclerView, etc
  1. Architecture:
  • MvvM without any framework just the plain MvvM patterm
  • Similar to Xamarin.Forms where we set first page in App.xaml.cs
public partial class App : Application
    {

        public App()
        {
            InitializeComponent();
            MainPage = new MainPage();
        }
}

Which means,

How do I set my first ViewModel as start page for both iOS and android in App.cs

For my Xamarin Native App.

Without using any MvvM framework eg: MvvMCross / MvvMPrism / MvvMLite

Thanks All.

Samy Gray
  • 43
  • 7
  • 2
    Android and iOS native don't have data binding mechanisms, making a pure MVVM approach without any third party frameworks difficult – Jason Nov 27 '22 at 13:08
  • @Jason Thanks Jason for the information. I think perhaps i will have to use MvvM-framework eventually. – Samy Gray Nov 27 '22 at 14:35
  • 1
    [OPINION] Don’t try to unify it that far. iOS and Android have fundamentally different user-interaction specifications. When using Xamarin Native, write each platform exactly the way you would if you were writing in that platform’s native language. You can still have a shared viewmodel, but (IMHO) it isn’t worth trying to automate the connection between View and VM. A VM is simply a set of Properties and Methods that don’t depend on any UI classes. Put everything platform-independent there, and use it like any c# class. No magic needed. – ToolmakerSteve Nov 27 '22 at 19:16
  • @ToolmakerSteve thanks Steve for a POV that should also be given a thought. Myself would definitely try the approach as you said to get an idea – Samy Gray Dec 03 '22 at 07:11

0 Answers0