-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Alternate color of items when items are added or removed #1852
Alternate color of items when items are added or removed #1852
Conversation
Anyone know why we're not using the ItemIndex property? Is this not available in older SDKs? Example of where we are not using it, but could: https://github.com/skendrot/UWPCommunityToolkit/blob/5c4a58823496ac446b5879b54db27b3d3a3f1277/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase/ListViewExtensions.cs#L129 |
I don't think there is a reason, and it's probably a good optimization to use ItemIndex |
I can add it to this PR if it's available in older SDKs |
The docs say it's available starting in 10240 - it should be ok |
@skendrot, were you planing on adding the ItemIndex property here? |
Yup, I'll get that in |
@@ -22,6 +24,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions | |||
/// </summary> | |||
public static class ListViewExtensions | |||
{ | |||
private static Dictionary<IObservableVector<object>, Windows.UI.Xaml.Controls.ListViewBase> _itemsForList = new Dictionary<IObservableVector<object>, Windows.UI.Xaml.Controls.ListViewBase>(); |
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.
Why not make using Windows.UI.Xaml.Controls
and remove useless code?
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.
Need to fully qualify because of the ListViewBase extensions class
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.
Ok. Fair.
This PR is linked to unclosed issues. Please check if one of these issues should be closed: #1837 |
Issue: #1837
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When an item is added or removed from a list, the item itself gets the correct color but items below it do not update
What is the new behavior?
When an item is inserted or removed the background color will update for that item and all items below it
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Change also unsubscribes from all events for the ListViewBase control.