Browse Source

Handle debug-step Enter before tree items consume it

TreeViewItem handles Enter for expand and collapse before bubble-phase handlers run, so install the replay shortcut in the tunnel phase to keep group-row commands reachable.

Assisted-by: OpenCode:openai/gpt-5.5:OpenCode
pull/3847/head
Siegfried Pammer 6 days ago committed by Siegfried Pammer
parent
commit
7d54d207a9
  1. 1
      ILSpy/Views/DebugSteps.axaml
  2. 5
      ILSpy/Views/DebugSteps.axaml.cs

1
ILSpy/Views/DebugSteps.axaml

@ -45,7 +45,6 @@ @@ -45,7 +45,6 @@
ItemsSource="{Binding Steps}"
SelectedItem="{Binding SelectedStep, Mode=TwoWay}"
DoubleTapped="OnTreeDoubleTapped"
KeyDown="OnTreeKeyDown"
x:CompileBindings="False">
<TreeView.Styles>
<!-- Hide rows that neither match the filter nor lead to a match, and expand the tree

5
ILSpy/Views/DebugSteps.axaml.cs

@ -37,6 +37,11 @@ namespace ICSharpCode.ILSpy.Views @@ -37,6 +37,11 @@ namespace ICSharpCode.ILSpy.Views
public DebugSteps()
{
InitializeComponent();
// TreeViewItem.OnKeyDown consumes Enter/Return to expand or collapse the focused row
// (marking the event handled) before it bubbles, so a bubble-phase handler never sees
// Enter on a group row. Intercept in the tunnel phase, ahead of the item, so Enter and
// Shift+Enter drive the show-state commands for both leaf and group steps.
StepsTree.AddHandler(InputElement.KeyDownEvent, OnTreeKeyDown, RoutingStrategies.Tunnel, handledEventsToo: true);
}
void OnTreeDoubleTapped(object? sender, TappedEventArgs e)

Loading…
Cancel
Save