Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Jul 19, 2025

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 PR #30453 regressed the fix introduced here #29469. The regression hasn't been caught by a flaky UI test, so I've improved it

Copilot AI review requested due to automatic review settings July 19, 2025 23:48
@kubaflo kubaflo requested a review from a team as a code owner July 19, 2025 23:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request is part of a systematic effort to suppress CS0618 obsolete warnings throughout the .NET MAUI Controls codebase, specifically focusing on ListView and TableView related components. The changes primarily add #pragma warning disable/restore CS0618 directives around code that uses obsolete ListView, TableView, and Cell APIs.

Key Changes:

  • Addition of #pragma warning disable/restore CS0618 pragmas around obsolete ListView, TableView, and Cell API usage
  • Addition of obsolete attributes to Cell-related classes (ViewCell, TextCell, SwitchCell, ImageCell, EntryCell)
  • Suppression of obsolete warnings in compatibility handlers for ListView on iOS, Windows, and Android platforms

Reviewed Changes

Copilot reviewed 287 out of 1252 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ Multiple iOS ListView handler files with CS0618 pragma suppressions around obsolete Cell and ListView API usage
src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/ Windows ListView handler files with CS0618 pragma suppressions
src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ Android ListView handler files with CS0618 pragma suppressions
src/Controls/src/Core/Cells/ Cell classes marked with Obsolete attributes
Various other files Miscellaneous changes including pragma suppressions, typo fixes, and minor updates


#pragma warning disable CA1416, CA1422 // TODO: 'UITableViewCell.TextLabel', DetailTextLabel is unsupported on: 'ios' 14.0 and later
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
Copy link

Copilot AI Jul 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Multiple consecutive #pragma warning disable directives for the same warning (CS0618) could be consolidated into a single directive that spans the entire method or class section.

Copilot uses AI. Check for mistakes.
Comment on lines 102 to 108
#pragma warning disable CS0618 // Type or member is obsolete
if (_previousFrame != Frame)
#pragma warning disable CS0618 // Type or member is obsolete
_previousFrame = Frame;
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
}
Copy link

Copilot AI Jul 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Nested pragma warning directives make the code harder to read. Consider using a single pragma warning disable at the method level instead of multiple nested ones.

Suggested change
#pragma warning disable CS0618 // Type or member is obsolete
if (_previousFrame != Frame)
#pragma warning disable CS0618 // Type or member is obsolete
_previousFrame = Frame;
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
}
if (_previousFrame != Frame)
#pragma warning restore CS0618 // Type or member is obsolete

Copilot uses AI. Check for mistakes.
Comment on lines 70 to 102
#pragma warning restore CS0618 // Type or member is obsolete
var realCell = (EntryCellTableViewCell)GetRealCell(entryCell);

#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
if (e.PropertyName == EntryCell.LabelProperty.PropertyName)
UpdateLabel(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.TextProperty.PropertyName)
UpdateText(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.PlaceholderProperty.PropertyName)
UpdatePlaceholder(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.KeyboardProperty.PropertyName)
UpdateKeyboard(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.LabelColorProperty.PropertyName)
UpdateLabelColor(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.HorizontalTextAlignmentProperty.PropertyName)
UpdateHorizontalTextAlignment(realCell, entryCell);
else if (e.PropertyName == Cell.IsEnabledProperty.PropertyName)
UpdateIsEnabled(realCell, entryCell);
else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
UpdateHorizontalTextAlignment(realCell, entryCell);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
Copy link

Copilot AI Jul 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Multiple consecutive restore directives should match the corresponding disable directives. The pattern of multiple nested pragma directives creates maintenance burden and reduces readability.

Suggested change
#pragma warning restore CS0618 // Type or member is obsolete
var realCell = (EntryCellTableViewCell)GetRealCell(entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
if (e.PropertyName == EntryCell.LabelProperty.PropertyName)
UpdateLabel(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.TextProperty.PropertyName)
UpdateText(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.PlaceholderProperty.PropertyName)
UpdatePlaceholder(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.KeyboardProperty.PropertyName)
UpdateKeyboard(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.LabelColorProperty.PropertyName)
UpdateLabelColor(realCell, entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.HorizontalTextAlignmentProperty.PropertyName)
UpdateHorizontalTextAlignment(realCell, entryCell);
else if (e.PropertyName == Cell.IsEnabledProperty.PropertyName)
UpdateIsEnabled(realCell, entryCell);
else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
UpdateHorizontalTextAlignment(realCell, entryCell);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
var realCell = (EntryCellTableViewCell)GetRealCell(entryCell);
#pragma warning disable CS0618 // Type or member is obsolete
if (e.PropertyName == EntryCell.LabelProperty.PropertyName)
UpdateLabel(realCell, entryCell);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.TextProperty.PropertyName)
UpdateText(realCell, entryCell);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.PlaceholderProperty.PropertyName)
UpdatePlaceholder(realCell, entryCell);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.LabelColorProperty.PropertyName)
UpdateLabelColor(realCell, entryCell);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
else if (e.PropertyName == EntryCell.HorizontalTextAlignmentProperty.PropertyName)
UpdateHorizontalTextAlignment(realCell, entryCell);
#pragma warning restore CS0618 // Type or member is obsolete
else if (e.PropertyName == Cell.IsEnabledProperty.PropertyName)
UpdateIsEnabled(realCell, entryCell);
else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
UpdateHorizontalTextAlignment(realCell, entryCell);

Copilot uses AI. Check for mistakes.
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 19, 2025
@kubaflo kubaflo changed the base branch from main to net10.0 July 19, 2025 23:51
@kubaflo kubaflo changed the title [ [Net10] [iOS] ScrollView content offset RTL - fix Jul 19, 2025
@kubaflo kubaflo self-assigned this Jul 19, 2025
@kubaflo
Copy link
Contributor Author

kubaflo commented Jul 20, 2025

Closed in favour of #30724

@kubaflo kubaflo closed this Jul 20, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant