Open GallaFrancesco opened 5 months ago
I've been making some simple use of it in a FuncUI application and there could be some 'official' bindings for it, though I don't think the core library should depend on it.
Why not? The DataGrid
control is supported and it's managed by the Avalonia organization as well. I know TreeDataGrid
is a separate package but technically DataGrid
is as well, even though the sources are in the AvaloniaUI repo https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls.DataGrid/DataGrid.cs
Would you contribute the bindings?
I'm not entirely happy with how we included the bindings for data grid in the main library. This creates a transitive dependency on Avalonia.Controls.DataGrid for all projects referencing FuncUI.
We should have small binding packages for control libraries.
TreeDataGrid also has a dependency on System.Reactive, which is quite large itself, so I don't think forcing a dependency is ideal (not my descision of course)
TreeDataGrid also has a dependency on System.Reactive, which is quite large itself, so I don't think forcing a dependency is ideal (not my descision of course)
💯 agreed.
Hmm, had a look at my usage of TreeDataGrid and it's basically all code behind style and no real bindings - e.g. doing things like
let makeTreeDataSource initialItems =
let gridSauce =
new HierarchicalTreeDataGridSource<StructuredSectionContent>(items = initialItems)
gridSauce.Columns.Add(
HierarchicalExpanderColumn<StructuredSectionContent>(
TextColumn<StructuredSectionContent, string>("Name", (fun section -> section.DisplayName)),
(fun x -> x.SubSections),
(fun x -> not (Seq.isEmpty x.SubSections))
)
)
gridSauce.Columns.Add(
TextColumn<StructuredSectionContent, string>("Value", (fun section -> section.DisplayValue))
)
gridSauce
and then just assigning that to the Source
property of the grid in an init
function.
Are there any plans to support TreeDataGrid in FuncUI?
It should be possible to use it in place of
DataGrid
with the additional benefits of havingTreeView
on top and other perks such asSelectableTextBlock
by default onDataGridTextColumn
.