-
Notifications
You must be signed in to change notification settings - Fork 17
The commands attached to gestures in Android MAUI project will not run from MainThread #44
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
Comments
Yes, unfortunately this is a known issue. In the very early days somebody deleted an element in the event handler of that element. When my handler continued after the users code, an exception was raised because the element has already been disposed. So I raised all event handlers on a new thread. |
I see, understandable. Was wondering about this, because it seems that in the Xamarin version of MR.Gestures it still works on the Main thread :) |
AFAIK the code is the same. I'll have a look at it. |
Sorry, I still have troubles getting .NET8 RC1 running. |
I released version 4.0.0 now. This version is for .NET7 and 8. All the event handlers / commands on Android, It did not matter in Xamarin.Forms because many things there could also be changed from a BG thread. MAUI seems to be less forgiving. Version 4.0.0 DOES NOT include Xamarin.Forms anymore. It is now for MAUI only. If you still need it in XF, stay at v3. |
Hi,
It seems that when using an MR layout in MAUI Android app, when we attach a command to a gesture, the handler is called outside of Main thread. iOS works as expected. A simple test can be done in the sample project. In CustomEventArgsViewModel.cs add a thread check in OnDown method
Can we get more information on whether it is a know issue?
The text was updated successfully, but these errors were encountered: