Skip to content

Commit 2c937a0

Browse files
refactor: Use instance Dispatcher instead of CoreDispatcher.Main for consistency
Co-authored-by: MartinZikmund <[email protected]>
1 parent 169341a commit 2c937a0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Uno.UI/UI/Xaml/Media/Animation/ColorAnimationUsingKeyFrames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ private void Play()
246246
{ // Don't start the animator its a dependent animation
247247
// However, we still need to complete the animation to maintain consistency with WinUI
248248
State = TimelineState.Active;
249-
_ = CoreDispatcher.Main.RunAsync(CoreDispatcherPriority.Normal, () =>
249+
_ = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
250250
{
251251
if (State == TimelineState.Stopped)
252252
{

src/Uno.UI/UI/Xaml/Media/Animation/DoubleAnimationUsingKeyFrames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private void Play()
216216
{ // Don't start the animator its a dependent animation
217217
// However, we still need to complete the animation to maintain consistency with WinUI
218218
State = TimelineState.Active;
219-
_ = CoreDispatcher.Main.RunAsync(CoreDispatcherPriority.Normal, () =>
219+
_ = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
220220
{
221221
if (State == TimelineState.Stopped)
222222
{

src/Uno.UI/UI/Xaml/Media/Animation/Timeline.animation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private void Play()
286286
{ // Don't start the animator its a dependent animation
287287
// However, we still need to complete the animation to maintain consistency with WinUI
288288
State = TimelineState.Active;
289-
_ = CoreDispatcher.Main.RunAsync(CoreDispatcherPriority.Normal, () =>
289+
_ = _owner.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
290290
{
291291
if (State == TimelineState.Stopped)
292292
{

0 commit comments

Comments
 (0)