Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This seam to be required only on UWP projects, not on Android or IOS #57

Open
dinobu opened this issue Apr 15, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@dinobu
Copy link

commented Apr 15, 2019

I have code that looks like this:

Task.Run(async() =>
{
   IList<Model> list = await GetListAsync();
   foreach(var model in list)
   {
      //MyList is data bound to ListView.
      // This will work fine on Android and IOS but on UWP, it requires 
      //Device.BeginInvokeOnMainThread wrapping the call below.
      MyList.Add(model);  //MyList is data bound to ListView
   }
});

As per comments, it works fine on IOS and Android, but not on UWP.

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@conceptdev

This comment has been minimized.

Copy link
Contributor

commented May 5, 2019

What is your question @dinobu?

@dinobu

This comment has been minimized.

Copy link
Author

commented May 6, 2019

What is your question @dinobu?

Not a question, just a comment on your article here here https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.device.begininvokeonmainthread?view=xamarin-forms

I find that I need to use BehinInvokeOnMainThread only on UWP in above case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.