Oakrey.Applications.SplashScreen
4.0.3
dotnet add package Oakrey.Applications.SplashScreen --version 4.0.3
NuGet\Install-Package Oakrey.Applications.SplashScreen -Version 4.0.3
<PackageReference Include="Oakrey.Applications.SplashScreen" Version="4.0.3" />
<PackageVersion Include="Oakrey.Applications.SplashScreen" Version="4.0.3" />
<PackageReference Include="Oakrey.Applications.SplashScreen" />
paket add Oakrey.Applications.SplashScreen --version 4.0.3
#r "nuget: Oakrey.Applications.SplashScreen, 4.0.3"
#:package Oakrey.Applications.SplashScreen@4.0.3
#addin nuget:?package=Oakrey.Applications.SplashScreen&version=4.0.3
#tool nuget:?package=Oakrey.Applications.SplashScreen&version=4.0.3
Oakrey.Applications.SplashScreen
A .NET 10 WPF library that provides an async splash screen for Windows desktop applications. It runs arbitrary preload tasks in parallel, optionally checks for MSI updates, and returns a SplashResult that drives the application startup flow.
Main features
ISplashScreenServiceabstraction for showing the splash screen and awaiting startup completion.SplashScreenService<T>generic implementation whereTis the entry-point assembly marker used byMsiDeployment<T>.- Parallel execution of any number of preload
Taskinstances while the splash is visible. - Integrated MSI update flow: checks for update, shows update progress in a second splash window, and shuts down after applying.
SplashResultenum communicating the outcome (NoUpdateAvailable,UpdateSkipped,UpdateRequested,ShutdownRequested).ISplashScreenServiceextendsILoggerEngine� anyILogger.Informationcall forwarded through the service updates the on-screen loading text.SplashScreenConfigurationExtensionfor one-line DI registration.- Integrated
Oakrey.Loglogging andOakrey.Telemetryactivity tracing throughout the startup flow.
Project structure
SplashScreen/
ISplashScreenService.cs # Service abstraction (extends ILoggerEngine)
SplashScreenService.cs # Generic implementation with MSI update support
SplashWindow.xaml / .xaml.cs # WPF splash window (INPC, async ShowAsync)
SplashscreenConfigurationExtension.cs # IServiceCollection extension
SplashResult.cs # Enum describing startup outcome
Startup flow
flowchart TD
A[App starts] --> B[ShowSplashScreen called]
B --> C{requireUpdate?}
C -- No --> D[Run preload tasks]
C -- Yes --> E[CheckForUpdate + preload tasks in parallel]
E --> F{Update available?}
F -- No --> D
F -- Yes --> G[User sees Update / Skip buttons]
G -- Skip --> D
G -- Update --> H[Run MsiDeployment.Update]
H --> I[Application.Shutdown]
G -- Close --> J[ShutdownRequested]
D --> K[Return true - continue startup]
J --> L[Return false - abort startup]
Requirements
- .NET 10, Windows (
net10.0-windows7or later) - WPF (
UseWPFmust be enabled in the consuming project) Oakrey.Applications� providesIApplicationInfoandApplicationInfoOakrey.Msi� MSI deployment and update checkingOakrey.Files.Windows� file utilities (transitive)Oakrey.Wpf.Converters� WPF value converters used bySplashWindow
Installation
NuGet Package Manager
- Open your project in Visual Studio.
- Navigate to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
- Search for
Oakrey.Applications.SplashScreenand click Install.
.NET CLI
dotnet add package Oakrey.Applications.SplashScreen
Package Manager Console
Install-Package Oakrey.Applications.SplashScreen
Configuration
Register the service in your DI container. The generic parameter T must be a class from the entry-point assembly so that MsiDeployment<T> can locate the installed product:
services.ConfigureSplashScreenService<App>();
IApplicationInfo must also be registered. SplashScreenService<T> resolves it from the container to populate the window title, version label, and logo.
Example usage
Typical placement is in App.xaml.cs before the main window is shown:
public partial class App : Application
{
protected override async void OnStartup(StartupEventArgs e)
{
ServiceProvider provider = ConfigureServices();
ISplashScreenService splash = provider.GetRequiredService<ISplashScreenService>();
bool continueStartup = await splash.ShowSplashScreen(
requireUpdate: true,
preloadFunction: LoadSettingsAsync(), LoadCacheAsync());
if (!continueStartup)
{
Shutdown();
return;
}
MainWindow mainWindow = provider.GetRequiredService<MainWindow>();
mainWindow.Show();
}
}
SplashResult values
| Value | Meaning |
|---|---|
NoUpdateAvailable |
No update found; startup continues normally. |
UpdateSkipped |
Update was available but the user skipped it. |
UpdateRequested |
Update was applied; Application.Shutdown() is called internally. |
ShutdownRequested |
User closed the splash window; caller should abort startup. |
Development notes
SplashScreenService<T>usesDummyAppInfowhen constructed without DI (parameterless constructor), logging a warning. This is intended for design-time and testing scenarios only.- The
ILoggerEngine.Logoverride only reacts toLevel.Information; other log levels are ignored by the splash window text binding. - Update progress is shown in a second
SplashWindowinstance created with an"{AppName} Update"title and the downloaded version string.
License
MIT. See the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Oakrey.Applications.Base (>= 4.0.3)
- Oakrey.Files.Windows (>= 2.0.1)
- Oakrey.Msi (>= 1.0.0)
- Oakrey.Wpf.Converters (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.