Fix XAML compiled binding warnings in DeviceTests.Runners by adding x:DataType attributes #30219
+9
−4
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
This PR resolves 37 XC0022 warnings in the DeviceTests.Runners project by adding proper
x:DataType
attributes to enable compiled bindings for improved runtime performance.Problem
The DeviceTests.Runners project was generating numerous XC0022 warnings:
These warnings were appearing across three XAML files:
HomePage.xaml
- 16 warningsTestAssemblyPage.xaml
- 20 warningsTestResultPage.xaml
- 8 warningsSolution
Added appropriate
x:DataType
attributes to enable compiled bindings:HomePage.xaml
xmlns:local
namespace referencex:DataType="local:HomeViewModel"
to root ContentPagex:DataType="local:TestAssemblyViewModel"
to CollectionView DataTemplatex:DataType="CollectionView"
to binding with explicit Source referenceTestAssemblyPage.xaml
x:DataType="local:TestAssemblyViewModel"
to root ContentPagex:DataType="local:TestCaseViewModel"
to CollectionView DataTemplatex:DataType="CollectionView"
to binding with explicit Source referenceTestResultPage.xaml
xmlns:local
namespace referencex:DataType="local:TestResultViewModel"
to root ContentPageResults
The changes follow .NET MAUI best practices for compiled bindings as documented in the official guidance.
Fixes #30214.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.