Skip to content

Fixed the OnPlatform does not work for header property in Collection view #28935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

NanthiniMahalingam
Copy link
Contributor

Issue Details

When setting OnPlatform for the Header property in the CollectionView, the exact value of the Header property is not displayed.

Root Cause

When OnPlatform is set for the Header property in the CollectionView, the exact T value is not retrieved from the ApplyPropertiesVisitors.

Description of Changes

Retrieve the actual value from the IWrappedValue of the wrapped value, and return it instead of the OnPlatform type itself.

Fixes #25124

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output images:

Android

Before After

iOS

Before After

macOS

Before After

Windows

Before After

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 11, 2025
Copy link
Contributor

Hey there @@NanthiniMahalingam! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 11, 2025
@NanthiniMahalingam NanthiniMahalingam marked this pull request as ready for review April 14, 2025 03:41
@Copilot Copilot bot review requested due to automatic review settings April 14, 2025 03:41
@NanthiniMahalingam NanthiniMahalingam requested a review from a team as a code owner April 14, 2025 03:41
Copy link
Contributor

@Copilot 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.

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/Controls/tests/TestCases.HostApp/Issues/Issue25124.xaml: Language not supported

@@ -224,6 +224,17 @@ internal static object ConvertTo(this object value, Type toType, Func<TypeConver
}
}

// When toType is object and value is OnPlatform<T>, we need to return the wrapped value from IWrappedView
Copy link
Preview

Copilot AI Apr 14, 2025

Choose a reason for hiding this comment

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

The comment references 'IWrappedView' while the code uses 'IWrappedValue'. Consider updating the comment to avoid confusion.

Suggested change
// When toType is object and value is OnPlatform<T>, we need to return the wrapped value from IWrappedView
// When toType is object and value is OnPlatform<T>, we need to return the wrapped value from IWrappedValue

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@jsuarezruiz jsuarezruiz added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Apr 14, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

public void ShouldDisplayHeaderBasedOnOnPlatform()
{
App.WaitForElement("CollectionView");
VerifyScreenshot();
Copy link
Contributor

Choose a reason for hiding this comment

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

Pending snapshots. Already available in the latest build.

Example, Mac:
image

Could you commit the images?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OnPlatform does not work in Header of CollectionView
2 participants