You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a text box to the top bar of the pakfile explorer page to filter displayed items.
This is probably quite challenging. As far as I can tell, TreeDataGrid doesn't have a specific property for whether a node should be displayed or not; it just displays item in a list of a node's children (you provide an accessor function
So when the search changes, every node in the tree needs to determine which of it's children to display.
Probably the best way to do this is to change every directory node to hold a SourceList _source of all children, then track changes to a child node's reactive property IsVisible then do something like _source.Connect().AutoRefresh(x => x.IsVisible).Filter(x => x.IsVisible).BindTo(this, x => x.FilteredChildren); where FilteredChildren is an ObservableCollection, then determine if this node should be visible with FilteredChildren.CountChanged.Select(x => x > 0).Subscribe(x => IsVisible = x) (probably don't want ToPropertyEx here since IsVisible with be a regular reactive property not an ObservableAsProperty). Leaf nodes then listen to the search input children and change their IsVisible property accordingly, which should bubble up through the tree.
Hoooopefully that approach is okay. It sounds very expensive but not sure of alternatives due to how TreeDataGrid works.
This is mostly blocked until #39 is merged. Someone could get started if they want, but pakfile explorer code on that branch may change.
The text was updated successfully, but these errors were encountered:
Add a text box to the top bar of the pakfile explorer page to filter displayed items.
This is probably quite challenging. As far as I can tell, TreeDataGrid doesn't have a specific property for whether a node should be displayed or not; it just displays item in a list of a node's children (you provide an accessor function
lumper/src/Lumper.UI/ViewModels/Pages/PakfileExplorer/PakfileExplorerViewModel.cs
Lines 56 to 71 in f68c05b
So when the search changes, every node in the tree needs to determine which of it's children to display.
Probably the best way to do this is to change every directory node to hold a SourceList
_source
of all children, then track changes to a child node's reactive propertyIsVisible
then do something like_source.Connect().AutoRefresh(x => x.IsVisible).Filter(x => x.IsVisible).BindTo(this, x => x.FilteredChildren);
where FilteredChildren is an ObservableCollection, then determine if this node should be visible withFilteredChildren.CountChanged.Select(x => x > 0).Subscribe(x => IsVisible = x)
(probably don't want ToPropertyEx here since IsVisible with be a regular reactive property not an ObservableAsProperty). Leaf nodes then listen to the search input children and change theirIsVisible
property accordingly, which should bubble up through the tree.Hoooopefully that approach is okay. It sounds very expensive but not sure of alternatives due to how TreeDataGrid works.
This is mostly blocked until #39 is merged. Someone could get started if they want, but pakfile explorer code on that branch may change.
The text was updated successfully, but these errors were encountered: