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

TreeView should expose Header/Footer properties and make use of underlying ListView #8451

Open
michael-hawker opened this issue May 4, 2023 · 0 comments
Labels
bug Something isn't working feature proposal New feature proposal team-Controls Issue for the Controls team wct

Comments

@michael-hawker
Copy link
Collaborator

Describe the bug

TreeView's template uses a TreeViewList:

<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:

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

  1. Create a TreeView in XAML
  2. Try and set a Header property...
  3. 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

@michael-hawker michael-hawker added bug Something isn't working wct labels May 4, 2023
@bpulliam bpulliam added the team-Controls Issue for the Controls team label Aug 9, 2023
@ranjeshj ranjeshj added the feature proposal New feature proposal label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature proposal New feature proposal team-Controls Issue for the Controls team wct
Projects
None yet
Development

No branches or pull requests

3 participants