-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Fixed VisualState Update for CollectionView SelectedItem #25145
Merged
Conversation
This file contains 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
…or a CollectionView
Hey there @Vignesh-SF3580! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
jsuarezruiz
added
platform/windows 🪟
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
labels
Oct 9, 2024
Vignesh-SF3580
changed the title
[Windows
[Windows] Fixed VisualState Update for CollectionView SelectedItem
Oct 9, 2024
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
requested changes
Oct 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(129,4): error CS0103: The name 'UpdateItemContentControlSelection' does not exist in the current context [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(164,4): error CS0103: The name 'UpdateItemContentControlSelection' does not exist in the current context [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(246,36): error CS0120: An object reference is required for the non-static field, method, or property 'ItemsViewHandler<TItemsView>.ListViewBase' [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(250,24): error CS0120: An object reference is required for the non-static field, method, or property 'ItemsViewHandler<TItemsView>.ItemsView' [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(250,94): error CS0120: An object reference is required for the non-static field, method, or property 'ItemsViewHandler<TItemsView>.ItemsView' [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.19041.0]
C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.5.240802000\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets(841,9): error MSB3073: The command ""C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.5.240802000\buildTransitive\..\tools\net6.0\..\net472\XamlCompiler.exe" "D:\a\_work\1\s\artifacts\obj\Controls.Core\Release\net8.0-windows10.0.19041.0\\input.json" "D:\a\_work\1\s\artifacts\obj\Controls.Core\Release\net8.0-windows10.0.19041.0\\output.json"" exited with code 1. [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.19041.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(129,4): error CS0103: The name 'UpdateItemContentControlSelection' does not exist in the current context [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.20348.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(164,4): error CS0103: The name 'UpdateItemContentControlSelection' does not exist in the current context [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.20348.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(246,36): error CS0120: An object reference is required for the non-static field, method, or property 'ItemsViewHandler<TItemsView>.ListViewBase' [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.20348.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(250,24): error CS0120: An object reference is required for the non-static field, method, or property 'ItemsViewHandler<TItemsView>.ItemsView' [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.20348.0]
D:\a\_work\1\s\src\Controls\src\Core\Handlers\Items\SelectableItemsViewHandler.Windows.cs(250,94): error CS0120: An object reference is required for the non-static field, method, or property 'ItemsViewHandler<TItemsView>.ItemsView' [D:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net8.0-windows10.0.20348.0]
We have validated the issue and resolved it. Could you please check? |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Azure Pipelines successfully started running 3 pipeline(s). |
Foda
approved these changes
Oct 15, 2024
PureWeen
approved these changes
Oct 15, 2024
sheiksyedm
added
the
partner/syncfusion
Issues / PR's with Syncfusion collaboration
label
Dec 6, 2024
samhouts
added
fixed-in-9.0.10
fixed-in-net8.0-nightly
This may be available in a nightly release!
labels
Dec 16, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
community ✨
Community Contribution
fixed-in-9.0.10
fixed-in-net8.0-nightly
This may be available in a nightly release!
partner/syncfusion
Issues / PR's with Syncfusion collaboration
platform/windows 🪟
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.
RootCause
When the SelectedItem is programmatically changed in the collection, the VisualState of the corresponding item does not update as expected. This occurs because the SelectionChanged function restricts visual state changes based on a boolean flag, which prevents the necessary state transitions when the selection is updated programmatically.
Description of Change
This fix ensures that the visual state of items in CollectionView is properly updated when the selection changes. A new method, UpdateItemContentControlSelection, is introduced to handle the selection state of item controls, ensuring consistent updates regardless of whether the selection is made programmatically or by the user. This resolves the issue where item visual states were not being correctly updated after selection changes.
Issues Fixed
Fixes #22104
Tested the behaviour in the following platforms
Screenshots
CollectionView_VS_Issue.mp4
CollectionView_VS_Fixed.mp4