If the current thread dispatcher is null return the app level dispatcher#20313
Merged
Conversation
PureWeen
commented
Feb 2, 2024
mattleibow
reviewed
Feb 2, 2024
mattleibow
approved these changes
Feb 5, 2024
jsuarezruiz
reviewed
Feb 6, 2024
Contributor
jsuarezruiz
left a comment
There was a problem hiding this comment.
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]
Member
Author
|
/rebase |
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
15da882 to
4a3bcab
Compare
mattleibow
reviewed
Feb 6, 2024
mattleibow
approved these changes
Feb 6, 2024
Member
Author
|
iOS failures are unrelated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Account for scenarios where the first call to the application level IDispatcher is from a background thread.
FindDispatcherto fall back to ourApplicationDispatchercontainer. This means if the user callsApplication.Current.Dispatcherfrom 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.