Steven Kirk
c91863f46a
Correctly handle scrolling in TreeView.
6 years ago
Steven Kirk
e54aee8d0a
Make TreeViewPage work.
6 years ago
Steven Kirk
c9e37eabca
Fix merge error.
6 years ago
Steven Kirk
24a054137e
Use SelectionModel in TreeView.
6 years ago
Steven Kirk
9b77a737e4
Refactored SelectionModel.
`SelectionModel` as ported from WinUI is unsuitable for use with `TreeView` because it treats a node as being selected when all its child nodes are selected, which is fine for a tree of check boxes, but incorrect for basic `TreeView` selection.
Because fixing this requires moving away from the semantics/API of WinUI's `SelectionModel` I've to also simplify/sanitize the API a bit:
- What was previously `IsSelected` is now called `IsTreeSelected`
- Removed the `groupIndex`/`itemIndex` overloads; they extraneous from my POV and could be implemented on extension methods
- Removed the "At" prefix on some methods that take an `IndexPath`; I have no idea why that was there.
6 years ago
Steven Kirk
25689b21ff
Use SelectionModel in SelectingItemsControl .
6 years ago
Steven Kirk
4f14bc4468
ISelectionModel needs to implement INotifyPropertyChanged.
`AutoScrollToSelectedItem` needs to listen to changes to `AnchorIndex` so we need this interface to be implemented.
6 years ago
Steven Kirk
b564e704e0
Adjust SelectionModel.SelectedIndex logic.
Previously it would clear the current selection and set `SelectedIndex` only if the requested item was not already selected. This is inconsistent with how selection needs to work: setting `SelectedItem` should also clear any other selected items.
6 years ago
Dariusz Komosinski
8bde793800
Fix unit tests.
6 years ago
Dariusz Komosinski
b8e684076f
Verify that removing items raises events as well.
6 years ago
Dariusz Komosinski
b382e804ac
Failing unit tests for SelectingItemsControl events
6 years ago
Steven Kirk
add611e7e9
Merge branch 'feature/selectionmodel-reset-handling' into feature/selectionmodel-autoselect
6 years ago
Steven Kirk
40fb4541f6
Merge branch 'feature/selectionmodel-changed-notifications' into feature/selectionmodel-reset-handling
6 years ago
Steven Kirk
efab1c8266
Fix SelectionNode.Cleanup.
- Removed disposed child nodes
- Don't dispose child node with descendent selection
6 years ago
Steven Kirk
2bb23cedc9
Merge branch 'feature/selectionmodel' into feature/selectionmodel-changed-notifications
6 years ago
Steven Kirk
bd022cca39
Clean up when node removed.
6 years ago
Steven Kirk
f29a474a16
Merge branch 'feature/selectionmodel-reset-handling' into feature/selectionmodel-autoselect
6 years ago
Steven Kirk
a705f2b4a3
Merge branch 'feature/selectionmodel-changed-notifications' into feature/selectionmodel-reset-handling
6 years ago
Steven Kirk
e3d11a8288
Fix clearing nested selection not raising SelectionChanged.
6 years ago
Steven Kirk
520dc16c2a
Added failing test.
Clearing a nested selection doesn't raise `SelectionChanged`.
6 years ago
Steven Kirk
8a1e684bbf
Merge branch 'feature/selectionmodel-reset-handling' into feature/selectionmodel-autoselect
6 years ago
Steven Kirk
79b13b1d4f
Merge branch 'feature/selectionmodel-changed-notifications' into feature/selectionmodel-reset-handling
6 years ago
Steven Kirk
6dadd96b7b
Added ISelectionModel.Update().
6 years ago
Steven Kirk
426c670882
Added AutoSelect to ISelectionModel.
6 years ago
Steven Kirk
fd31157fcb
Merge branch 'feature/selectionmodel-reset-handling' into feature/selectionmodel-autoselect
6 years ago
Steven Kirk
f416454b5a
Merge branch 'feature/selectionmodel-changed-notifications' into feature/selectionmodel-reset-handling
6 years ago
Steven Kirk
7829e0cdab
Merge branch 'feature/selectionmodel' into feature/selectionmodel-changed-notifications
6 years ago
Steven Kirk
c8f0bec40d
Added ISelectionModel.
6 years ago
Steven Kirk
565de5b2e7
Merge branch 'feature/selectionmodel-reset-handling' into feature/selectionmodel-autoselect
6 years ago
Steven Kirk
d3888e7e99
Merge branch 'feature/selectionmodel-changed-notifications' into feature/selectionmodel-reset-handling
6 years ago
Steven Kirk
44cf7f24db
Expose API for batch updates.
6 years ago
Steven Kirk
0a608d47dc
Added SelectionMode.AutoSelect.
6 years ago
Steven Kirk
ee459635a8
Handle RetainSelectionOnReset w/ null source.
6 years ago
Steven Kirk
4dd0ec6e4e
Fix bad merge.
6 years ago
Steven Kirk
c0f34694a6
Fixed out of bounds in SelectionNode.
6 years ago
Steven Kirk
031ece5122
Merge branch 'feature/selectionmodel-changed-notifications' into feature/selectionmodel-reset-handling
6 years ago
Steven Kirk
a5890bda3f
Merge branch 'feature/selectionmodel' into feature/selectionmodel-changed-notifications
6 years ago
Steven Kirk
4de9fac5c1
Don't reset selection if source hasn't changed.
Also remove some `?.` operators that aren't needed.
6 years ago
Steven Kirk
ca324775e3
Merge branch 'feature/selectionmodel-changed-notifications' into feature/selectionmodel-reset-handling
6 years ago
Steven Kirk
04f8516c32
Handle null SelectionModel.Source.
6 years ago
Steven Kirk
01a1945201
Add nullable annotations.
6 years ago
Steven Kirk
9073234f72
Use SelectedItems for change event args.
6 years ago
Steven Kirk
b120e5282e
Lazily create the selected/deselected lists.
6 years ago
Steven Kirk
859aba1043
Refactor of SelectionModel change notifications.
To address issues found.
6 years ago
Steven Kirk
e2132fedf9
Added some failing tests.
That demonstrate some problems with the `SelectionModel` change notifications found so far.
6 years ago
Steven Kirk
7548dc9c2e
Added SelectionModel changed args.
`SelectionModel` as ported from WinUI has no information about what changed in a `SelectionChanged` event. This adds that information along with unit tests.
6 years ago
Steven Kirk
bc4eefcf1b
Add `IndexRange` list add/remove methods.
Add or remove index ranges from a list of index ranges, merging and splitting ranges as required.
6 years ago
Steven Kirk
fcaa250c72
Ported fix and test from WinUI.
https://github.com/microsoft/microsoft-ui-xaml/pull/1922
6 years ago
Steven Kirk
3f6e982be8
Added SelectionModel.RetainSelectionOnReset.
6 years ago
Steven Kirk
3a7d9f0800
Use SelectedItems for change event args.
6 years ago