From da55e94a4c78544b620189ddb5764505c0fc2f11 Mon Sep 17 00:00:00 2001 From: Gaoyang Date: Mon, 3 Aug 2026 13:45:31 +0800 Subject: [PATCH] fix: preserve custom Zstd level checkbox state in edit dialog UpdateCompressionLevelState() ran after CustomZstdLevelBox.IsChecked was set to true, and its Checked handler immediately unchecked the box because CompressionLevelRow was still disabled from the earlier no-image-path default. Reordering so the row state is refreshed first lets the checkbox stick. --- src/ManagedDrive.App/Views/CreateDiskDialog.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ManagedDrive.App/Views/CreateDiskDialog.xaml.cs b/src/ManagedDrive.App/Views/CreateDiskDialog.xaml.cs index 11e460e..1f24b05 100644 --- a/src/ManagedDrive.App/Views/CreateDiskDialog.xaml.cs +++ b/src/ManagedDrive.App/Views/CreateDiskDialog.xaml.cs @@ -124,13 +124,14 @@ public CreateDiskDialog(DiskOptions existing, IReadOnlyList? otherD CompressionLevelBox.SelectedIndex = CompressionLevels.IndexOf(existing.CompressionLevel); SaveOnExitBox.IsChecked = existing.SaveImageOnExit; + UpdateCompressionLevelState(); + if (existing.CustomZstdLevel is { } customZstdLevel) { CustomZstdLevelBox.IsChecked = true; CustomZstdLevelValue = customZstdLevel; } - UpdateCompressionLevelState(); UpdateAutoSaveEnabledState(); if (existing is { AutoSaveIntervalMinutes: { } minutes, ReadOnly: false })