-
Notifications
You must be signed in to change notification settings - Fork 776
Description
Describe the bug
TreeView's template uses a TreeViewList:
microsoft-ui-xaml/dev/TreeView/TreeView.xaml
Lines 36 to 48 in 0e2d882
| <ControlTemplate TargetType="local:TreeView"> | |
| <local:TreeViewList | |
| x:Name="ListControl" | |
| Background="{TemplateBinding Background}" | |
| ItemTemplate="{TemplateBinding ItemTemplate}" | |
| ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}" | |
| ItemContainerStyle="{TemplateBinding ItemContainerStyle}" | |
| ItemContainerStyleSelector="{TemplateBinding ItemContainerStyleSelector}" | |
| ItemContainerTransitions="{TemplateBinding ItemContainerTransitions}" | |
| CanDragItems="{TemplateBinding CanDragItems}" | |
| AllowDrop="{TemplateBinding AllowDrop}" | |
| CanReorderItems="{TemplateBinding CanReorderItems}"> | |
| </local:TreeViewList> |
Which is just a ListView:
microsoft-ui-xaml/dev/TreeView/TreeView.idl
Lines 101 to 104 in 0e2d882
| unsealed runtimeclass TreeViewList : Windows.UI.Xaml.Controls.ListView | |
| { | |
| TreeViewList(); | |
| } |
ListView has a Header and Footer property available like most XAML controls; however, TreeView does not.
TreeView should get Header and Footer properties and they should just be template bound to the underlying TreeViewList in the default template.
This would make moving from ListView/ItemsControl to TreeView easier as they would all support the Header/Footer property like most XAML controls. Came about from my exploration of applying my DataTable experiment to a TreeView, needed to do this manually in a sub-class, but it should be just built-in to the WinUI 2/3 versions of this control instead. Should be a straight-forward add-on. See: CommunityToolkit/Labs-Windows#415
Steps to reproduce the bug
- Create a
TreeViewin XAML - Try and set a
Headerproperty... - None exists...
Expected behavior
Should have standard Header/Footer properties like other XAML controls, makes it easier to have consistent UI and styling when creating various layouts and/or form-style UI.
Screenshots
No response
NuGet package version
WinUI 2 - Microsoft.UI.Xaml 2.8.2
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response