From 197e9c45ce91738edea1e2170de4fbe4a21856f9 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 25 Apr 2025 08:19:03 +0800 Subject: [PATCH] Improve code comments --- Flow.Launcher/App.xaml.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 20dd50668..b1ff136b3 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -79,12 +79,16 @@ namespace Flow.Launcher .AddSingleton() .AddSingleton() .AddSingleton() - .AddSingleton() .AddSingleton() - // Welcome view model & setting window view model is very simple so we just use one instance - .AddSingleton() + // Use one instance for main window view model because we only have one main window + .AddSingleton() + // Use one instance for welcome window view model & setting window view model because + // pages in welcome window & setting window need to share the same instance and + // these two view models do not need to be reset when creating new windows .AddSingleton() - // Setting page view models are complex so we use transient instance + .AddSingleton() + // Use transient instance for setting window page view models because + // pages in setting window need to be recreated when setting window is closed .AddTransient() .AddTransient() .AddTransient()