'Xamarin.Android MVVM and SetBindingContext/DataContext

I am working on a Xamarin.Android project (Not Xamnarin.Forms). All the tutorials i see are for Xamarin.Froms. I am unable to find anything which explains how to use MVVM pattern for Xamarin.Android project.

In my MainAcitity.cs I Dont have the SetBindingContext/DataContext methods, I am not really sure how can i Bind my ViewModel to my UI.

my VM

internal class MainVM : ViewModelBase
{
    private readonly DelegateCommand _BtnRegister;
    public ICommand BtnRegister { get; set; }

    public MainVM()
    {
        _BtnRegister = new DelegateCommand(onRegisterClick);
    }

    private void onRegisterClick(object commandParameter)
    {
        
    }
}

and here is my Activity File

    protected override void OnCreate(Bundle savedInstanceState)
    {

        base.OnCreate(savedInstanceState);


        SetContentView(Resource.Layout.activity_main);

    }

how do i Bind my VM to my Activity?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source