Skip to content

Commit f11f85d

Browse files
aclinickCopilot
andauthored
Fix #15: close finding pane reliably; Fix #16: exit Compare when opening Apps (#17)
- #15: BtnCloseFinding now uses a code-behind Click handler that clears OverviewFindingsList.SelectedItem before nulling SelectedFinding, so the ListView TwoWay binding can't immediately re-push the old selection back into the VM. - #16: NavView_ItemInvoked case 'apps' now exits Compare and Settings modes (matching cases 'compare' and 'settings'), so opening the Apps pane on top of an active Compare view hides the Compare sub-panel. Closes #15, closes #16. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5f41227 commit f11f85d

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

MSIXplainer/MainPage.xaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@
356356
<!-- All findings -->
357357
<TextBlock Text="All Findings" Style="{StaticResource SubtitleTextBlockStyle}" />
358358

359-
<ListView AutomationProperties.AutomationId="OverviewFindingsList"
359+
<ListView x:Name="OverviewFindingsList"
360+
AutomationProperties.AutomationId="OverviewFindingsList"
360361
ItemsSource="{x:Bind ViewModel.CategoryFindings, Mode=OneWay}"
361362
SelectedItem="{x:Bind ViewModel.SelectedFinding, Mode=TwoWay}"
362363
SelectionMode="Single">
@@ -519,9 +520,10 @@
519520
<!-- Close button -->
520521
<Button AutomationProperties.AutomationId="BtnCloseFinding"
521522
HorizontalAlignment="Right"
522-
Command="{x:Bind ViewModel.DismissSelectedFindingCommand}"
523+
Click="OnCloseFindingClick"
523524
Padding="4" MinWidth="0" MinHeight="0"
524-
Background="Transparent" BorderThickness="0">
525+
Background="Transparent" BorderThickness="0"
526+
ToolTipService.ToolTip="Close">
525527
<FontIcon Glyph="&#xE711;" FontSize="12" />
526528
</Button>
527529

MSIXplainer/MainPage.xaml.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ private async void NavView_ItemInvoked(NavigationView sender, NavigationViewItem
9797
switch (invoked.Tag)
9898
{
9999
case "apps":
100+
ExitCompareMode();
101+
ExitSettingsMode();
100102
await OpenAppsPaneAsync();
101103
break;
102104

@@ -195,6 +197,17 @@ private void ViewFinding_Click(object sender, RoutedEventArgs e)
195197
ViewModel.SelectedFinding = finding;
196198
}
197199

200+
/// <summary>
201+
/// Closes the finding detail pane. Clears the OverviewFindingsList selection
202+
/// explicitly first so the TwoWay binding can't immediately re-push the old
203+
/// selection back into ViewModel.SelectedFinding once we null it.
204+
/// </summary>
205+
private void OnCloseFindingClick(object sender, RoutedEventArgs e)
206+
{
207+
OverviewFindingsList.SelectedItem = null;
208+
ViewModel.SelectedFinding = null;
209+
}
210+
198211
/// <summary>
199212
/// Copies a manifest property value to the clipboard. Wraps the clipboard
200213
/// call in try/catch so a transient clipboard failure never bubbles up as

0 commit comments

Comments
 (0)