-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Spec] Add IDispatcher to the IAnimatable interface #17
Labels
Comments
hartez
changed the title
Add IDispatcher to the IAnimatable interface
[Spec] Add IDispatcher to the IAnimatable interface
May 18, 2020
28 tasks
lytico
referenced
this issue
in lytico/maui
Aug 2, 2021
…main_linux_210713 merge dotnet/main main_linux & enhance 210713
ghost
locked as resolved and limited conversation to collaborators
Feb 19, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Add IDispatcher to IAnimatable interface.
The animation methods in Forms automatically handle UI thread marshaling for the user. Unfortunately, they do this using the static Device.IsInvokeRequired and Device.BeginInvokeOnMainThread, which are incompatible with multi-window applications on some platforms. To address this, we can add a dispatcher to the IAnimatable interface to use for these thread checks.
API
On
Xamarin.Forms.IAnimatable
, addIDispatcher Dispatcher { get; }
Backward Compatibility
Anyone who has implemented the IAnimatable interface will need to add an IDispatcher to their implementation.
Difficulty : Low
The main implemnentation of IAnimatable in Forms is VisualElement, which already has an IDispatcher. The other implementations (Tizen's NavigationDrawer and a couple of test classes) will need to add it as well. The explicit type check in the DoAction method of AnimationExtensions will need to be removed, and the use of the static Device methods will need to be replaced with Dispatcher.
The text was updated successfully, but these errors were encountered: