Forum Xamarin.Android

MVVMLight Android Bindings

vzus95vzus95 USUniversity ✭✭
edited November 2017 in Xamarin.Android

Hi All,

I might be totally in wrong with my approach, feel free to educate me.

Doing sample app in native android using mvvmlight.

From my view model have a Relaycommand

`public CustomDataModel data;

public RelayCommand GetData;

constructor
{
GetData = new RelayCommand(Get);
}

public async void Get()
{
var ss = await service.get("sample");
data = ss;
}`
In Android activity oncreate.

btnSearch.SetCommand(viewModel.GetData);

Now, on button search click viewmodel method been called. I have a custom method in activity

private void updateUI() { if (viewModel.data != null) { ...... } }
How to call updateUI after viewModel.GetData execution.

Thanks

Sign In or Register to comment.