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;