-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix nth-last-child styles on virtualizing layouts #10055
Conversation
Will hopefully make it a bit more obvious if it breaks in future: previously it was easier to miss as both `nth-child` and `nth-last-child` changed the foreground.
And a passing test for `nth-child` selector.
You can test this PR using the following package version. |
_provider.TotalCountChanged += TotalCountChanged; | ||
} | ||
|
||
protected override void Deinitialize() | ||
{ | ||
_provider.ChildIndexChanged -= ChildIndexChanged; |
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.
- Do we even need to subscribe on TotalCountChanged when it's not reversed?
- TotalCountChanged is not unsubscribed on Deinitialize
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.
- I think this depends on the answer to the question in the PR description
- This too, really..,
@maxkatz6 ping - still waiting for your thoughts on the question in the PR description. |
You can test this PR using the following package version. |
I don't have strong preference here. Having a single event makes sense in general. If keep two different events, then total count can be added to the TotalCountChanged event args. So TryGetTotalCount/GetChildIndex calls can be basically eliminated except of initial read. |
Merge it into existing `IChildIndexProvider.ChildIndexChanged` event.
You can test this PR using the following package version. |
You can test this PR using the following package version. |
What does the pull request do?
After #9677 was merged,
nth-last-child
styles stopped working inListBox
due to the problem described here.This PR modifies the
IChildIndexProvider
API to add the following:ChildIndexChangedEventArgs
TotalCountChanged
event was addedIt also removes the hack in
ItemsControl
which was used to work around this problem.Questions
I've marked this PR as draft for the moment because I'm not sure about one thing:
We now have two events on
IChildIndexProvider
but they will always be subscribed by the same object. Maybe we need to merge the two events into a single event with anAction
property which would be an enum of:ChildIndexChanged
TotalCountChanged
Breaking changes
The
IChildIndexProvider
interface has changed. Shouldn't be much of a problem as it's unlikely to be client-implemented.Fixed issues
Fixes #9997