Skip to content

Commit

Permalink
fix(winui): implemented Window::DispatcherQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoy312 committed Apr 14, 2022
1 parent 777a592 commit 033ae9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Uno.UI/UI/Xaml/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public sealed partial class Window

private List<WeakEventHelper.GenericEventHandler> _sizeChangedHandlers = new List<WeakEventHelper.GenericEventHandler>();

#if HAS_UNO_WINUI
public global::Microsoft.UI.Dispatching.DispatcherQueue DispatcherQueue { get; } = global::Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();

This comment has been minimized.

Copy link
@nickrandolph

nickrandolph Apr 14, 2022

Contributor

@Xiaoy312 can we confirm with @jeromelaban that GetForCurrenThread will return a value when accessed from a background thread. I know that when running on WinUI this method typically returns null when requested from a non-UI thread

This comment has been minimized.

Copy link
@jeromelaban

jeromelaban Apr 14, 2022

Member

It does not. GetForCurrentThread() returns null when from a background thread.

#endif

#pragma warning disable 67
/// <summary>
/// Occurs when the window has successfully been activated.
Expand Down

0 comments on commit 033ae9b

Please sign in to comment.