From 82d75bcb6b178d13b9fd642dccfa22df9391f76a Mon Sep 17 00:00:00 2001 From: Andrew Clinick <80841394+aclinick@users.noreply.github.com> Date: Thu, 4 Jun 2026 07:13:56 -0700 Subject: [PATCH 1/2] Fix #15: close finding pane reliably; Fix #16: exit Compare when opening Apps - #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> --- MSIXplainer/MainPage.xaml | 8 +++++--- MSIXplainer/MainPage.xaml.cs | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/MSIXplainer/MainPage.xaml b/MSIXplainer/MainPage.xaml index de58ca5..f275cb2 100644 --- a/MSIXplainer/MainPage.xaml +++ b/MSIXplainer/MainPage.xaml @@ -356,7 +356,8 @@ - @@ -519,9 +520,10 @@ diff --git a/MSIXplainer/MainPage.xaml.cs b/MSIXplainer/MainPage.xaml.cs index a6c67bc..00dfdee 100644 --- a/MSIXplainer/MainPage.xaml.cs +++ b/MSIXplainer/MainPage.xaml.cs @@ -97,6 +97,8 @@ private async void NavView_ItemInvoked(NavigationView sender, NavigationViewItem switch (invoked.Tag) { case "apps": + ExitCompareMode(); + ExitSettingsMode(); await OpenAppsPaneAsync(); break; @@ -195,6 +197,17 @@ private void ViewFinding_Click(object sender, RoutedEventArgs e) ViewModel.SelectedFinding = finding; } + /// + /// Closes the finding detail pane. Clears the OverviewFindingsList selection + /// explicitly first so the TwoWay binding can't immediately re-push the old + /// selection back into ViewModel.SelectedFinding once we null it. + /// + private void OnCloseFindingClick(object sender, RoutedEventArgs e) + { + OverviewFindingsList.SelectedItem = null; + ViewModel.SelectedFinding = null; + } + /// /// Copies a manifest property value to the clipboard. Wraps the clipboard /// call in try/catch so a transient clipboard failure never bubbles up as From 4326680cb00d402e76987cb1f007d1181cb7f976 Mon Sep 17 00:00:00 2001 From: Andrew Clinick <80841394+aclinick@users.noreply.github.com> Date: Thu, 4 Jun 2026 07:18:12 -0700 Subject: [PATCH 2/2] Fix #15 (round 2): bind finding-pane visibility to explicit bool The Click handler from the previous commit fired correctly but the pane still didn't collapse, because the visibility binding `{x:Bind local:MainPage.NullToCollapsed(ViewModel.SelectedFinding)}` wasn't re-evaluating reliably after the property cleared. - New observable bool MainPageViewModel.IsFindingDetailVisible, kept in sync with SelectedFinding via a partial OnSelectedFindingChanged hook. - Pane Visibility now binds to BoolToVisibility(IsFindingDetailVisible). - Close handler also sets IsFindingDetailVisible = false explicitly. - BtnCloseFinding bumped to 32x32 with bigger glyph for a reliable hit target. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- MSIXplainer/MainPage.xaml | 7 ++++--- MSIXplainer/MainPage.xaml.cs | 5 ++++- MSIXplainer/ViewModels/MainPageViewModel.cs | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/MSIXplainer/MainPage.xaml b/MSIXplainer/MainPage.xaml index f275cb2..3a0b7a7 100644 --- a/MSIXplainer/MainPage.xaml +++ b/MSIXplainer/MainPage.xaml @@ -511,7 +511,7 @@ @@ -519,12 +519,13 @@ diff --git a/MSIXplainer/MainPage.xaml.cs b/MSIXplainer/MainPage.xaml.cs index 00dfdee..879ae5e 100644 --- a/MSIXplainer/MainPage.xaml.cs +++ b/MSIXplainer/MainPage.xaml.cs @@ -200,12 +200,15 @@ private void ViewFinding_Click(object sender, RoutedEventArgs e) /// /// Closes the finding detail pane. Clears the OverviewFindingsList selection /// explicitly first so the TwoWay binding can't immediately re-push the old - /// selection back into ViewModel.SelectedFinding once we null it. + /// selection back into ViewModel.SelectedFinding once we null it. Then + /// explicitly toggles IsFindingDetailVisible so the pane collapses even if + /// the SelectedFinding PropertyChanged notification gets coalesced. /// private void OnCloseFindingClick(object sender, RoutedEventArgs e) { OverviewFindingsList.SelectedItem = null; ViewModel.SelectedFinding = null; + ViewModel.IsFindingDetailVisible = false; } /// diff --git a/MSIXplainer/ViewModels/MainPageViewModel.cs b/MSIXplainer/ViewModels/MainPageViewModel.cs index f5eb16a..49e30f6 100644 --- a/MSIXplainer/ViewModels/MainPageViewModel.cs +++ b/MSIXplainer/ViewModels/MainPageViewModel.cs @@ -25,6 +25,22 @@ public partial class MainPageViewModel : ObservableObject [ObservableProperty] public partial ManifestFinding? SelectedFinding { get; set; } + /// + /// Whether the right-side finding-detail pane should be visible. Tracked as a + /// distinct observable bool (rather than binding visibility to a + /// NullToCollapsed function on SelectedFinding) because the x:Bind function + /// re-evaluation was unreliable in combination with the Overview ListView's + /// TwoWay SelectedItem binding — the pane would stay open after the close + /// button cleared the selection. See issue #15. + /// + [ObservableProperty] + public partial bool IsFindingDetailVisible { get; set; } + + partial void OnSelectedFindingChanged(ManifestFinding? value) + { + IsFindingDetailVisible = value is not null; + } + [ObservableProperty] public partial string AssessmentMessage { get; set; } = string.Empty;