private static async Task EnsureSettingsAndConfigurationAreBootstrapped() { if (AppSettings == null) { AppSettings = await SettingsViewModel.CreateInstance(); } ExternalResourcesHelper ??= new ExternalResourcesHelper(); await ExternalResourcesHelper.LoadSelectedTheme(); InteractionViewModel ??= new InteractionViewModel(); SidebarPinnedController ??= await SidebarPinnedController.CreateInstance(); LibraryManager ??= new LibraryManager(); DrivesManager ??= new DrivesManager(); NetworkDrivesManager ??= new NetworkDrivesManager(); CloudDrivesManager ??= new CloudDrivesManager(); WSLDistroManager ??= new WSLDistroManager(); // Start off a list of tasks we need to run before we can continue startup _ = Task.Factory.StartNew(async() => { if (App.AppSettings.ShowLibrarySection) { await LibraryManager.EnumerateDrivesAsync(); } await DrivesManager.EnumerateDrivesAsync(); await CloudDrivesManager.EnumerateDrivesAsync(); await NetworkDrivesManager.EnumerateDrivesAsync(); await WSLDistroManager.EnumerateDrivesAsync(); }); }