-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
If the current thread dispatcher is null return the app level dispatcher #20313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D:\a\_work\1\s\src\Compatibility\ControlGallery\src\Issues.Shared\TestPages\TestPages.cs(962,17): error CS0122: 'ApplicationDispatcher' is inaccessible due to its protection level [D:\a\_work\1\s\src\Compatibility\ControlGallery\test\WinUI.UITests\WinUI.UITests.csproj]
/rebase |
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
15da882
to
4a3bcab
Compare
iOS failures are unrelated |
Description of Change
Account for scenarios where the first call to the application level IDispatcher is from a background thread.
FindDispatcher
to fall back to ourApplicationDispatcher
container. This means if the user callsApplication.Current.Dispatcher
from a background thread they won't fail.IPlatformApplication.Current.Services.Get<IDispatcher>()
from a background thread. Because we're no longer initializing that path via initializers we need to account for the case where a user is trying to resolve a scoped service from the static container.