The overlay control rendered on top of PleasantWindow content during startup. Populated automatically from IPleasantSplashScreen — do not instantiate directly.
The splash screen is automatically created and displayed by the PleasantWindow when an IPleasantSplashScreen is provided:
public class MySplashScreen : IPleasantSplashScreen
{
public IBrush? Background { get; } = new SolidColorBrush(Color.Parse("#2D2D2D"));
public IImage? AppIcon { get; } = new Bitmap("Assets/icon.png");
public string? AppName { get; } = "My Application";
public object? SplashScreenContent { get; } = null;
}
// In your window
public class MyWindow : PleasantWindow
{
public MyWindow()
{
SplashScreen = new MySplashScreen();
}
}| Property | Type | Description |
|---|---|---|
SplashScreen |
IPleasantSplashScreen? |
The IPleasantSplashScreen driving this control |
AppName |
string? |
Application name displayed when no icon or custom content is set |
AppIcon |
IImage? |
Image displayed in the splash screen |
SplashContent |
object? |
Fully custom content — overrides icon and name |
Implement this interface to provide splash screen data:
public interface IPleasantSplashScreen
{
IBrush? Background { get; }
IImage? AppIcon { get; }
string? AppName { get; }
object? SplashScreenContent { get; }
}Provide fully custom splash screen content:
public class CustomSplashScreen : IPleasantSplashScreen
{
public IBrush? Background { get; } = new SolidColorBrush(Colors.Blue);
public IImage? AppIcon { get; } = null;
public string? AppName { get; } = null;
public object? SplashScreenContent { get; } = new StackPanel
{
Children =
{
new TextBlock { Text = "Loading...", FontSize = 24 },
new ProgressBar { IsIndeterminate = true }
}
};
}The splash screen displays content in the following priority order:
SplashScreenContent(if not null)AppIcon(if not null)AppName(if not null)
The background is automatically set from the IPleasantSplashScreen.Background property:
public class MySplashScreen : IPleasantSplashScreen
{
public IBrush? Background { get; } = new SolidColorBrush(Color.Parse("#1A1A2E"));
}- This control is typically created and managed by
PleasantWindow, not instantiated directly - The control automatically populates its properties from the
IPleasantSplashScreenwhen it changes - Use
IPleasantSplashScreento define your splash screen appearance