Example #1
0
        /// <summary>
        /// 在应用程序由最终用户正常启动时进行调用。
        /// 将在启动应用程序以打开特定文件等情况下使用。
        /// </summary>
        /// <param name="e">有关启动请求和过程的详细信息。</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            if (Window.Current.Content is null)
            {
                Window.Current.Content = new Shell();
            }

            if (e.PrelaunchActivated == false)
            {
                // 确保当前窗口处于活动状态
                Window.Current.Activate();
                ExtendAcrylicIntoTitleBar();
            }

            LogService.ConfigLogger();
            DataLoadService.LoadFromDataAsync();
            await ThemeSelectorService.InitializeAsync().ConfigureAwait(false);

            await ThemeSelectorService.SetRequestedThemeAsync();
        }