[Testing] Added Tests for Issue31139 and DispatcherExtensions#31213
Merged
jfversluis merged 3 commits intoinflight/currentfrom Aug 29, 2025
unknown repository
Merged
[Testing] Added Tests for Issue31139 and DispatcherExtensions#31213jfversluis merged 3 commits intoinflight/currentfrom unknown repository
jfversluis merged 3 commits intoinflight/currentfrom
unknown repository
Conversation
added 2 commits
August 18, 2025 18:02
Contributor
|
Hey there @@anandhan-rajagopal! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a UI test case for Issue 31139 to verify that property binding updates from background threads are correctly marshaled to the UI thread without causing crashes in .NET MAUI applications.
Key changes:
- Creates a test page with a Label bound to a view model property that updates from a background thread
- Implements an automated UI test that waits for the "Success" text to appear, confirming the binding mechanism works correctly
- Uses proper threading patterns with INotifyPropertyChanged to simulate real-world background update scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/Controls/tests/TestCases.HostApp/Issues/Issues31139.xaml |
XAML page with Label bound to Status property for testing background thread updates |
src/Controls/tests/TestCases.HostApp/Issues/Issues31139.xaml.cs |
View model with background thread that updates Status property using INotifyPropertyChanged |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31139.cs |
NUnit test that verifies "Success" text appears within 3 seconds |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31139.cs
Outdated
Show resolved
Hide resolved
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
approved these changes
Aug 28, 2025
jfversluis
approved these changes
Aug 29, 2025
PureWeen
pushed a commit
that referenced
this pull request
Sep 8, 2025
Update issue string Added more tests related to Dispatcher Extensions and addresssed copilot suggestions
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
This pull request introduces a new test case to verify that binding updates from a background thread are correctly marshaled to the UI thread, and adds comprehensive unit tests for dispatcher extension methods. The changes ensure that updates to UI-bound properties from background threads do not cause crashes and are properly reflected in the UI.
New test case for background thread binding updates
Issue31139XAML page and corresponding view model to demonstrate and test property changes from a background thread, verifying that UI updates occur safely and as expected. [1] [2]Issue31139.cs) to automatically check that the status label updates to "Success" without crashing when the property changes on a background thread.Unit tests for dispatcher extension methods
DispatcherExtensionsTestclass with multiple unit tests to ensure thatDispatchIfRequiredandDispatchIfRequiredAsyncbehave correctly depending on whether dispatching is required, covering both synchronous and asynchronous scenarios.Output
Fixes #31185