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
6 years ago
Steven Kirk
96619e4440
Added failing test.
`ItemsPresenter.Items` isn't correctly in sync with `ItemsControl.Items` when assigning new `Items`.
6 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.
8 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.
9 years ago
Dan Walmsley
d3f4dacdbc
whitespace
9 years ago
Dan Walmsley
9a0fead203
Added unit test to assert new behavior.
9 years ago
Dan Walmsley
f3d2520f6c
Fix ItemsControl tests.
9 years ago
Dan Walmsley
a5a59c3e8c
Updated ItemsControl test for new behaviour.
9 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
Steven Kirk
fbb7ea759b
Make ItemContainerGenerator create containers
Make the untyped ItemContainerGenerator create `ContentPresenter`
containers when the data isn't a control. This is required for correct
binding to `DataContext` in a data template.
10 years ago
Steven Kirk
5cd9b98057
Added ItemsControl.ItemTemplate property.
10 years ago
Steven Kirk
5be41985c3
Renamed Perspex -> Avalonia
10 years ago
Steven Kirk
79843ae311
Make DataTemplate-created controls namescopes.
10 years ago
Steven Kirk
c810f95904
Don't ApplyTemplate on nested templated controls...
...during ApplyTemplate. This was so that ItemsControls could their find
ItemsPresenters nested in other templated controls. Instead use
IItemsPresenterHost to make the presenter register itself with its
TemplatedParent.
10 years ago
Steven Kirk
a6b74db847
Merge branch 'logical-tree' into leaks
10 years ago
Steven Kirk
71cd3d965b
More work on XAML control theme.
10 years ago
Steven Kirk
01417ba883
Renamed ControlTemplate -> FuncControlTemplate
10 years ago
Steven Kirk
292a04d973
Renamed DataTemplate -> FuncDataTemplate.
11 years ago
Steven Kirk
338a1c0d91
Added ItemsControl.MemberSelector
And use it to select the TabItem.Content property for the Deck in a
TabControl.
11 years ago
Steven Kirk
c4cfd967dc
Fix DataContexts.
This makes it so that IControls are no longer DataTemplate-able,
breaking TabControl. Need to find a better way.
11 years ago
Nikita Tsukanov
01e2c90bc5
Removed this.
11 years ago
Steven Kirk
145411020b
Ran .net core code formatter.
11 years ago
Steven Kirk
6151aef188
Removed file headers.
11 years ago
Steven Kirk
d11d779414
Trying to fix capitalization of tests and docs AGAIN.
11 years ago
Steven Kirk
1a2fba4798
Revert "Fixed casing of Docs and Tests directories."
This reverts commit 845b28a2c2 .
11 years ago
Steven Kirk
845b28a2c2
Fixed casing of Docs and Tests directories.
11 years ago
Steven Kirk
c7dc89f06b
Fixed applying control templates.
And added unit tests for it.
11 years ago
Steven Kirk
c0fc38358f
Refactored templates a bit.
Added interfaces, moved them to Controls.Templates namespace and added
base classes for common Func<> templates.
11 years ago
Steven Kirk
fba2633ab9
Renamed Decorator.Content property as Child.
11 years ago
Steven Kirk
fef04a5f5d
Implemented Menus a bit better.
Now appear correctly in logical tree and use general-purpose mechanisms
rather than direct communication between MenuItems.
11 years ago
Steven Kirk
ba8552cb81
Renamed Id to Name.
No reason to be different for the sake of it.
11 years ago
Steven Kirk
acb63e425b
Fix ItemsControl :empty class.
11 years ago
Steven Kirk
f3e362dddb
Fix DevTools.
And add test to make sure it doesn't happen again.
11 years ago
Steven Kirk
5a1aca2876
Make template find methods to extension class.
11 years ago