Skip to content
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

Refactor ItemsControl container generation and implement smooth virtualization #9677

Merged
merged 70 commits into from
Jan 17, 2023

Commits on Dec 7, 2022

  1. Begin refactoring ItemsPresenter.

    A lot still broken, in particular virtualization is completely removed.`ItemsPresenter` now no longer has an `Items` or `ItemTemplate` property; it detects when it's hosted in an `ItemsControl`. `IItemsPresenter` interface removed.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    692c0c1 View commit details
    Browse the repository at this point in the history
  2. Initial (re)impl of VirtualizingStackPanel.

    Currently only supports smooth scrolling.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    c20e3c2 View commit details
    Browse the repository at this point in the history
  3. Removed VirtualizationMode.

    If you want a different virtualization mode, use a different panel.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    5d1f9f4 View commit details
    Browse the repository at this point in the history
  4. Refactored ItemContainerGenerator.

    A bunch of tests still failing, and some code commented out, but outlines the new API shape.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    1101f28 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    57b1ba9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e07e5ce View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a1d809b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b3982f1 View commit details
    Browse the repository at this point in the history
  9. Make a few more tests pass.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    fab8f15 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    14d429e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    bbd3d2a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    a9ca852 View commit details
    Browse the repository at this point in the history
  13. Fixed SelectingItemsControlTests.

    `ListBox` now needs a root as it uses a `VirtualizingStackPanel`.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    c1ee26c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    6626a2e View commit details
    Browse the repository at this point in the history
  15. Setup TabItems.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    8bb1349 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    2c4572a View commit details
    Browse the repository at this point in the history
  17. Fix test.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    7e1068f View commit details
    Browse the repository at this point in the history
  18. Reimplement DisplayMemberBinding.

    Use a slightly different approach to the one that was previously there: create an item template that contains `DisplayMemberBinding`. This is the approach that WPF broadly uses too.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    004103a View commit details
    Browse the repository at this point in the history
  19. Fix failing test.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    a6423b2 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    2ae5c9c View commit details
    Browse the repository at this point in the history
  21. Refresh containers when relevant property changes.

    When `ItemsControl.DisplayMemberBinding` or `ItemTemplate` changes, refresh the containers.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    000f393 View commit details
    Browse the repository at this point in the history
  22. Remove TabControl.HeaderDisplayMemberBinding.

    As `DisplayMemberBinding` should select the member for the header (in WPF it's `DisplayMemberPath`). Also set `TabItem.TabStripPlacement`.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    1950e4b View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    306c045 View commit details
    Browse the repository at this point in the history
  24. Remove unneeded tests.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    a7a7103 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    6f04196 View commit details
    Browse the repository at this point in the history
  26. Fix StyleIncludeTests.

    Wasn't finding `RelativeSource` type at times.
    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    4a92fad View commit details
    Browse the repository at this point in the history
  27. Reinstated DialogsPage.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    84abb69 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    56db1db View commit details
    Browse the repository at this point in the history
  29. Use more consistent naming.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    c99307c View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    be2da5c View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    e7f3b23 View commit details
    Browse the repository at this point in the history
  32. Make logic a bit clearer.

    grokys committed Dec 7, 2022
    Configuration menu
    Copy the full SHA
    08f90dc View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2022

  1. Reimplemented Carousel.

    Only `VirtualizingCarouselPanel` currently implemented.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    f0c89a6 View commit details
    Browse the repository at this point in the history
  2. Remove FillMode on transitions.

    Now that containers are being recycled, the state of the control following the animation needs to be the same as before the animation.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    c54e466 View commit details
    Browse the repository at this point in the history
  3. Update comment.

    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    06de4bb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    627d9c5 View commit details
    Browse the repository at this point in the history
  5. Use ItemsSourceView in ItemsControl.

    Fixes #54.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    3195df0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b678339 View commit details
    Browse the repository at this point in the history
  7. Make ItemsSourceView ctors private.

    So in future we could have different `ItemSourceView` concrete implementations that e.g. have an inner `IReadOnlyList<T>` in order to address #8764.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    518391b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f042127 View commit details
    Browse the repository at this point in the history
  9. Invalidate measure less.

    Only invalidate the measure when the viewport changes in the direction of scroll.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    d4a8b98 View commit details
    Browse the repository at this point in the history
  10. Fix side panel width.

    Variable width was causing the panel to flicker around as the values change.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    bcb3a6d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    395a90d View commit details
    Browse the repository at this point in the history
  12. Prepare new containers before adding to tree.

    Prevents compiled bindings failing because the `DataContext` is not yet set and is still inheriting the parent `DataContext`.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    0b3aa3a View commit details
    Browse the repository at this point in the history
  13. Fix menu theming.

    Don't allow child menus to inherit the top level `Menu`'s `ItemContainerTheme` as that is specific to top-level menu items.
    grokys committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    67d200c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    14df77a View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2022

  1. Add scroll anchoring support to ItemsControl.

    This necessitated adding another stage to the container preparation lifecycle that will be called after the container is added to the logical and visual trees: `ItemContainerPrepared`. Such a method is going to be necessary anyway if we ever want to expose events for container realization so will probably be worth having regardless.
    grokys committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    6d267f9 View commit details
    Browse the repository at this point in the history
  2. Mark methods obsolete.

    grokys committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    95e854a View commit details
    Browse the repository at this point in the history
  3. Removed IItemsPresenterHost.

    grokys committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    d7201d2 View commit details
    Browse the repository at this point in the history
  4. Tweaked VirtualizingPanel API.

    And added some more doc comments.
    grokys committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    d5a585d View commit details
    Browse the repository at this point in the history
  5. Remove references to "model index".

    It's a TreeDataGrid concept (which is where this code was adapted from).
    grokys committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    9610c80 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2022

  1. Configuration menu
    Copy the full SHA
    3c59202 View commit details
    Browse the repository at this point in the history
  2. Use correct submodule commit.

    Somehow got changed to an older commit.
    grokys committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    f371f18 View commit details
    Browse the repository at this point in the history
  3. Remove Smooth suffix.

    `VirtualizingStackPanel` only does smooth scrolling now.
    grokys committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    9781a13 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c55b7a9 View commit details
    Browse the repository at this point in the history
  5. Fix property name.

    grokys committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    76b51cf View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2022

  1. Fix adorners in DevTools.

    grokys committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    54bc9dd View commit details
    Browse the repository at this point in the history
  2. Handle item move and replace.

    grokys committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    039fb90 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    17f7541 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    da14232 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2b02afc View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2022

  1. Configuration menu
    Copy the full SHA
    f5e0869 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2023

  1. Configuration menu
    Copy the full SHA
    a8df486 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    54924fc View commit details
    Browse the repository at this point in the history
  3. Remove debug code.

    grokys committed Jan 9, 2023
    Configuration menu
    Copy the full SHA
    0dcf836 View commit details
    Browse the repository at this point in the history
  4. Fix nits.

    grokys committed Jan 9, 2023
    Configuration menu
    Copy the full SHA
    1ef4df1 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2023

  1. A few more tests.

    Trying to get a repro for an issue seen with DataBox but so far unable to repro in a unit test. Anyway, these tests should be useful.
    grokys committed Jan 13, 2023
    Configuration menu
    Copy the full SHA
    a9fd9f4 View commit details
    Browse the repository at this point in the history
  2. Add redundancy for a problem I can't repro in tests.

    There's a problem with `DataBox` that I can't repro in a unit test. Add some redundancy such that if we're still waiting for a viewport update after carrying out a layout pass, force another layout.
    grokys committed Jan 13, 2023
    Configuration menu
    Copy the full SHA
    8600f30 View commit details
    Browse the repository at this point in the history
  3. Don't recycle focused element.

    Fixes #9269
    grokys committed Jan 13, 2023
    Configuration menu
    Copy the full SHA
    d0f479d View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2023

  1. Configuration menu
    Copy the full SHA
    17e1d37 View commit details
    Browse the repository at this point in the history