fix: ShowPage null reference when RadioButton.checked fires during XAML load

This commit is contained in:
雾启工作室
2026-06-28 11:25:16 +08:00
parent 063850ec56
commit 33c7b50beb

View File

@@ -39,8 +39,11 @@ namespace BetterSeewo.Manager
private void ShowPage(StackPanel page) private void ShowPage(StackPanel page)
{ {
foreach (var p in new[] { PageInstall, PageInk, PageConvert, PageTouch, PageActivate }) foreach (var p in new[] { PageInstall, PageInk, PageConvert, PageTouch, PageActivate })
{
if (p != null)
p.Visibility = p == page ? Visibility.Visible : Visibility.Collapsed; p.Visibility = p == page ? Visibility.Visible : Visibility.Collapsed;
} }
}
private void Minimize_Click(object s, RoutedEventArgs e) => WindowState = WindowState.Minimized; private void Minimize_Click(object s, RoutedEventArgs e) => WindowState = WindowState.Minimized;
private void Maximize_Click(object s, RoutedEventArgs e) => private void Maximize_Click(object s, RoutedEventArgs e) =>