Steven Kirk
e3bf19a399
Update tests due to changes in #10803 .
3 years ago
Steven Kirk
39db10b345
Handle recycling control items inside containers.
Fixes #10825
3 years ago
Steven Kirk
670eea0977
Modernized ItemsControl tests.
3 years ago
Steven Kirk
9d012fbb6b
Fix terminology.
3 years ago
Steven Kirk
791ea8beef
Added container lifecycle events.
Seems we weren't calling `ClearItemContainer` for `ItemIsOwnContainer` items in `PanelContainerGenerator`. Fixed that too.
3 years ago
Steven Kirk
f8eceb4af9
Update usages of ItemsControl Items/ItemsSource.
- Use `ItemsSource` when appropriate
- When `Items` is appropriate, don't use the setter
3 years ago
Steven Kirk
183fed8985
Add more tests.
One failing.
3 years ago
Steven Kirk
9856711494
Don't modify logical tree in ItemsSource mode.
3 years ago
Steven Kirk
ba7e8a20b5
Added ItemsControl.ItemsSource.
`ItemsControl` now works more like WPF, in that there are separate `Items` and `ItemsSource` properties. For backwards compatibility `Items` can still be set, though the setter is deprecated. `Items` needed to be changed from `IEnumerable` to `IList` though.
3 years ago
Tom Edwards
81530c4231
Converted a variety of writeable DirectProperty definitions to StyledProperty
3 years ago
Julien Lebosquain
3791fa8a51
Don't add ItemsControl items to its panel logical children
3 years ago
Steven Kirk
b92134c682
Added failing test for #10246 .
3 years ago
Steven Kirk
000f393be7
Refresh containers when relevant property changes.
When `ItemsControl.DisplayMemberBinding` or `ItemTemplate` changes, refresh the containers.
3 years ago
Steven Kirk
004103a925
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.
3 years ago
Steven Kirk
7e1068f441
Fix test.
3 years ago
Steven Kirk
1101f28dd7
Refactored ItemContainerGenerator.
A bunch of tests still failing, and some code commented out, but outlines the new API shape.
3 years ago
Steven Kirk
692c0c155d
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.
3 years ago
Giuseppe Lippolis
de4b55f8ee
feat(tests): Address rule CA1822
4 years ago
Tim
ab4bb208f5
Add Unit Test
4 years ago
Steven Kirk
f57c0ffbec
Added ItemContainerTheme property.
Otherwise there's no easy way to apply themes to item containers.
4 years ago
Steven Kirk
05c1f58308
Added ItemContainerTheme property.
Otherwise there's no easy way to apply themes to item containers.
4 years ago
Murdo R Ergeaux
b1db4ce6d2
Update ItemsControl PseudoClasses on ItemCount property changed
5 years ago
Murdo R Ergeaux
dbab1666a2
Use ItemCount to determine PseudoClass in ItemsControl
5 years ago
Steven Kirk
3518f19b2a
Revert "ItemsControl+ItemVirtualizerSimple don not recreate containers when Items or ItemTemplate are replaced"
5 years ago
adospace
13cd835bc0
ItemsControl+ItemVirtualizerSimple did not recreated item containers when Items or ItemTemplate were replaced
5 years ago
Steven Kirk
41831066c2
Revert "Fix selection after deleting an item."
6 years ago
Steven Kirk
6555a51f5a
Fix selection after deleting an item.
`SelectionModel` needs to subscribe to `CollectionChanged` on the items before `ItemsControl` in order for the selection to be correct when we come to setting the selected state.
Because `SelectionModel.Source` isn't subscribed during initialization in `ItemsChanged`, we also need to make sure we don't subscribe `ItemsControl` to the collection changes during initialization. Instead subscribe in `OnInitialized` (this requires a few tests to be rooted in order to be called).
Fixes #4293
6 years ago
Steven Kirk
4d01dacd77
Remove copyright headers.
Some of our files had them, some didn't. They serve no purpose legally so best to remove the ceremony.
6 years ago
Steven Kirk
56825d252e
Expose ContentPresenter from ItemsControl.LogicalChildren.
Exposing the `ContentPresenter.Child` in `ItemsControl.LogicalChildren` was causing problems when detaching and reattaching an `ItemsControl` to the logical tree. Instead, expose the `ContentPresenter` itself in effect meaning that `ItemsControl` has a "container" type just like the controls derived from it.
Fixes #3487
6 years ago
Steven Kirk
632c40340a
Added failing test for #3487 .
6 years ago
Steven Kirk
9107c0e96e
Added another failing test.
Adapted from failing test described by @MarchingCube in PR feedback: https://github.com/AvaloniaUI/Avalonia/pull/3177#issuecomment-547515972
7 years ago
Steven Kirk
96619e4440
Added failing test.
`ItemsPresenter.Items` isn't correctly in sync with `ItemsControl.Items` when assigning new `Items`.
7 years ago
Nikita Tsukanov
991f767c3c
Removed outdated tests
7 years ago
Nikita Tsukanov
1ab923c02e
Removed WithNameScope
7 years ago
Nikita Tsukanov
fe5c1cec76
Use INameScope from IServiceProvider
7 years ago
Nikita Tsukanov
fa55755b71
Manually handle name scope registrations
7 years ago
Steven Kirk
2fa8247f01
Removed MemberSelector.
7 years ago
Steven Kirk
1e12b2c37b
Don't focus non-focusable controls.
When navigating `ItemsControl` with keyboard.
8 years ago
Steven Kirk
9c1c8749dd
Added failing test for #1709 .
8 years ago
Jeremy Koritzinsky
da0ab8b681
Move the styling system up the stack to live right below Avalonia.Animation since it has no dependencies on anything further down the dependency chain
8 years ago
Steven Kirk
5cc5b91930
Fix xunit warnings.
9 years ago
Steven Kirk
22bda08a90
Lazily initialize DataTemplates.
Added an `IDataTemplateHost` interface with a `IsDataTemplatesInitialized` property to prevent the need for allocating empty `DataTemplates` collections for many controls.
9 years ago
Dan Walmsley
ed05f842c0
Corrected order of Assert arguments.
10 years ago
Dan Walmsley
d3f4dacdbc
whitespace
10 years ago
Dan Walmsley
9a0fead203
Added unit test to assert new behavior.
10 years ago
Dan Walmsley
f3d2520f6c
Fix ItemsControl tests.
10 years ago
Dan Walmsley
a5a59c3e8c
Updated ItemsControl test for new behaviour.
10 years ago
Steven Kirk
7b3e25949e
Revert "Revert "Set ContentPresenter.DataContext in UpdateChild.""
This reverts commit bf02ae41a9 .
10 years ago
Steven Kirk
bf02ae41a9
Revert "Set ContentPresenter.DataContext in UpdateChild."
This reverts commit f3c7ea27a1 .
10 years ago
Steven Kirk
f3c7ea27a1
Set ContentPresenter.DataContext in UpdateChild.
Thus delaying any changes that changing the data context would make
until we know we have the correct child.
10 years ago