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

[Spec] Add IDispatcher to the IAnimatable interface #17

Closed
hartez opened this issue May 18, 2020 · 0 comments
Closed

[Spec] Add IDispatcher to the IAnimatable interface #17

hartez opened this issue May 18, 2020 · 0 comments
Labels
area-animation Animation, Transitions, Transforms proposal/open t/breaking 💥

Comments

@hartez
Copy link
Contributor

hartez commented May 18, 2020

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, add IDispatcher 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.

@hartez hartez added the t/enhancement ☀️ New feature or request label May 18, 2020
@hartez hartez changed the title Add IDispatcher to the IAnimatable interface [Spec] Add IDispatcher to the IAnimatable interface May 18, 2020
@hartez hartez removed the t/enhancement ☀️ New feature or request label May 18, 2020
@jsuarezruiz jsuarezruiz added the area-animation Animation, Transitions, Transforms label May 21, 2020
@Redth Redth closed this as completed Jul 8, 2021
lytico referenced this issue in lytico/maui Aug 2, 2021
…main_linux_210713

merge dotnet/main main_linux & enhance 210713
@ghost 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.
Labels
area-animation Animation, Transitions, Transforms proposal/open t/breaking 💥
Projects
None yet
Development

No branches or pull requests

5 participants