From 868a35977c128ac4d10db84c6deafd2b9f1cc882 Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Wed, 20 May 2026 23:33:51 +0800 Subject: [PATCH] fix: set ComboBox defaults from collection items (reference equality) - Initialize Config.Platform/AppType from Platforms[0]/AppTypes[0] in VM - Remove SelectedIndex=0 from XAML (conflicts with SelectedItem binding) - Ensures selected item IS a collection item, not a separate instance --- src/ViewModels/SimulateViewModel.cs | 2 ++ src/Views/SimulateView.axaml | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ViewModels/SimulateViewModel.cs b/src/ViewModels/SimulateViewModel.cs index 9f1eb3d..c419a1b 100644 --- a/src/ViewModels/SimulateViewModel.cs +++ b/src/ViewModels/SimulateViewModel.cs @@ -36,6 +36,8 @@ public partial class SimulateViewModel : ViewModelBase public SimulateViewModel() { _status = _loc["Patch.Ready"]; + Config.Platform = Platforms[0]; + Config.AppType = AppTypes[0]; } async Task PickFolder(string title) diff --git a/src/Views/SimulateView.axaml b/src/Views/SimulateView.axaml index 39064cd..4c27b84 100644 --- a/src/Views/SimulateView.axaml +++ b/src/Views/SimulateView.axaml @@ -38,12 +38,10 @@ + SelectedItem="{Binding Config.Platform}" Margin="8,0,16,0"/> + SelectedItem="{Binding Config.AppType}" Margin="8,0"/>