[Net 11] - Annotated remaining Converter classes for nullability - 3#30875
[Net 11] - Annotated remaining Converter classes for nullability - 3#30875NirmalKumarYuvaraj wants to merge 4 commits intodotnet:net11.0from
Conversation
|
Hey there @@NirmalKumarYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
786ef98 to
37357a5
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request continues the series of updates to annotate remaining converter classes for nullability in the .NET MAUI Controls library. The changes focus on enabling nullable reference types and modernizing code syntax to improve type safety and code readability.
Key Changes:
- Enables nullable reference types (
#nullable enable) across multiple type converter classes - Updates method signatures in type converters to support nullable parameters
- Modernizes code syntax with file-scoped namespaces and improved conditional statements
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| TextAlignment.cs | Enabled nullability and modernized namespace declaration with improved conditional formatting |
| ShellSection.cs | Updated type converter method signatures for nullable parameters |
| ShellNavigationState.cs | Enabled nullability for ShellNavigationStateTypeConverter |
| ShellItem.cs | Updated ShellItemConverter with nullable parameter support |
| ShellContent.cs | Added nullability annotations to ShellContentConverter |
| StrokeShapeTypeConverter.cs | Comprehensive refactoring with nullability, modernized syntax, and improved error handling |
| ResourceDictionary.cs | Restructured RDSourceTypeConverter with nullable support and method reordering |
| FormattedString.cs | Updated FormattedStringConverter with nullable annotations |
| FontAttributes.cs | Enhanced FontAttributesConverter with nullability and improved conditional formatting |
| Button.cs | Updated ButtonContentTypeConverter with nullable support |
| BindablePropertyConverter.cs | Major refactoring with nullability enabled and method reorganization |
| PublicAPI files | Added new public API entries for all updated converter method overrides |
|
@NirmalKumarYuvaraj Could you rebase and fix the conflicts? |
1e16118 to
c1c1980
Compare
@jsuarezruiz , I have rebased and resolved the conflicts. please let me know if you have any concerns. |
|
@NirmalKumarYuvaraj Could you rebase and fix the conflicts? (Sorry, again!) |
f5cbaf0 to
16a1df6
Compare
@jsuarezruiz , I have resolved the conflicts. |
|
needs rebase again sorry |
16a1df6 to
0777f61
Compare
@rmarinho , rebased |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
kubaflo
left a comment
There was a problem hiding this comment.
Can you rebase and retarget to net 11 please?
446d1c3 to
ff29de1
Compare
|
@kubaflo , Updated the changes |
|
|
kubaflo
left a comment
There was a problem hiding this comment.
Could you please resolve conflicts?
|
|
ff29de1 to
27a4b7f
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 30875Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 30875" |
|
@jfversluis could you take a look? |
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!
Description of Change
This pull request introduces significant updates to improve nullability annotations, refactor type converters, and enhance code readability in the
Microsoft.Maui.Controlsnamespace. The changes primarily focus on enabling nullable reference types, refining type conversion logic, and modernizing the syntax.Nullability Enhancements:
#nullable enable) across several files, improving type safety and reducing potential null reference exceptions. [1] [2] [3] [4]Type Converter Refactoring:
ConvertFromandConvertTomethods in multiple type converters to support nullable parameters and improve handling of edge cases. [1] [2] [3] [4]Syntax Modernization:
{}for single-line conditional statements with block formatting for better readability. [1] [2];syntax instead of braces, aligning with modern C# conventions. [1] [2] [3]Public API Updates:
CanConvertFrom,CanConvertTo,ConvertFrom, andConvertTomethods inBindablePropertyConverter,ButtonContentTypeConverter, and other converters to thePublicAPI.Unshipped.txtfile. This ensures the updated methods are documented as part of the public API.These changes collectively improve maintainability, type safety, and adherence to modern C# practices in the
Microsoft.Maui.Controlscodebase.Issues Fixed
Fixes #