question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dispatcher is null in WinUI Desktop in WinUI 3 Preview 4

See original GitHub issue

Dispatcher of Page and other UI elements are return null in WinUI Desktop after upgrade of WinUI 3 Preview 4. We have to run async using Dispatcher. But Dispatcher returns null in WinUI Desktop but WinUI UWP returns proper value for Dispatcher. It works fine in WinUI 3 Preview3

await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { // My Action here });

Expected behavior Dispatcher should not be null or sugestion to Runasync

NuGet package version:

[Microsoft.WinUI 3.0.0-preview4.210210.4]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

22reactions
fiftincommented, Sep 23, 2021

Why Dispatcher was not marked as Deprecated?

I spent a lot of time until find this issue

12reactions
marb2000commented, Feb 17, 2021

@Berkunath Dispatcher and CoreDisptacher are null in the Preview 4. You should use DispatcherQueue instead. Here you can find a demo that uses it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DispatcherQueue null when trying to update Ui property in ...
In a WinUI 3 in Desktop app I have a property to update which is bound to the ui via x:Bind . I...
Read more >
WinUI 3 Project Reunion 0.8 Preview (April 2021)
Dispatcher property is always null, but the Window.DispatcherQueue property can be used as an alternative. These APIs only work in UWP apps. In ......
Read more >
Packaged, Unpackaged and Self-Contained WinUI 3 Apps ...
In this post we're going to look at the startup logic for a WinUI 3 Desktop application and discuss how this relates to...
Read more >
Untitled
Winui3 dispatcher is null Using DI with ViewModel classes Learn WinUI 3.0 Web25 ... Dispatcher is null in WinUI Desktop in WinUI 3...
Read more >
[Solved]-How to get DispatcherQueue in WinUI 3 Desktop ...
Yes, getting DispatcherQueue is different from WPF, it is something like that in WinUI3: var dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found