Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Aug 16, 2023
2 parents 5543dd6 + 4b85cae commit 0434ec5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion RemnantSaveGuardian/Views/Pages/WorldAnalyzerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@
</TabItem>
<TabItem Header="{lex:Loc Missing Items}">
<Grid>
<TreeView Name="treeMissingItems" VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.IsVirtualizing="True" ContextMenuOpening="treeMissingItems_ContextMenuOpening" MouseDown="treeMissingItems_MouseDown">
<TreeView Name="treeMissingItems" VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.IsVirtualizing="True" ContextMenuOpening="treeMissingItems_ContextMenuOpening">
<TreeView.Resources>
<Style TargetType="TreeViewItem" BasedOn="{StaticResource {x:Type TreeViewItem}}">
<EventSetter Event="TreeViewItem.MouseDown" Handler="treeMissingItems_MouseDown"/>
<Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
<Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
<Setter Property="Visibility" Value="{Binding Path=Visibility, Mode=TwoWay}" />
Expand Down
18 changes: 15 additions & 3 deletions RemnantSaveGuardian/Views/Pages/WorldAnalyzerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,12 @@ private void CollapseExpandAllItems(List<TreeListClass> lstItems, bool bExpand)
foreach (TreeListClass item in lstItems)
{
item.IsExpanded = bExpand;
if (item.Childnode != null) CollapseExpandAllItems(item.Childnode, bExpand);
var child = item.Childnode;
if (child != null && child.Count > 0)
{
var node = child[0].Childnode;
if (node != null && node.Count > 0) { CollapseExpandAllItems(child, bExpand); }
}
}
}
private void treeMissingItems_ContextMenuOpening(object sender, ContextMenuEventArgs e)
Expand All @@ -413,8 +418,15 @@ private void treeMissingItems_ContextMenuOpening(object sender, ContextMenuEvent

private void treeMissingItems_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
var item = e.Source as TreeViewItem;
if (item != null) { item.IsSelected = true; }
var item = sender as TreeViewItem;
if (item != null)
{
var node = (TreeListClass)item.Header;
if (node != null) {
node.IsSelected = true;
e.Handled = true;
}
}
}

private void WorldAnalyzerFilter_TextChanged(object sender, TextChangedEventArgs e)
Expand Down

0 comments on commit 0434ec5

Please sign in to comment.