PleasantWindow

April 9, 2026 · View on GitHub

A custom Window subclass with a Fluent-style title bar, optional blur, subtitle, custom icon/title content, and splash screen support.

Basic usage

<PleasantWindow xmlns="https://github.com/avaloniaui"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                x:Class="YourApp.MainWindow"
                Title="My App"
                Width="1000" Height="650"
                WindowStartupLocation="CenterScreen">
    <!-- your content -->
</PleasantWindow>
public partial class MainWindow : PleasantWindow
{
    public MainWindow() => InitializeComponent();
}

Properties

PropertyTypeDefaultDescription
TitleBarTypePleasantTitleBar.TypeClassicType of title bar: Classic, ClassicExtended, or Compact
EnableCustomTitleBarbooltrueReplaces the OS title bar with the Fluent one
OverrideMacOSCaptionbooltrueOverrides native macOS caption buttons
ExtendsContentIntoTitleBarboolfalseLets window content render behind the title bar area
TitleBarHeightdouble32Height of the title bar (read-only, auto-set)
SubtitlestringSecondary text shown next to the title
DisplayIconobjectCustom icon in the title bar (e.g. DrawingImage, PathIcon)
DisplayTitleobjectReplaces the text title with arbitrary content
LeftTitleBarContentobjectContent injected to the left of the title
TitleContentobjectContent placed in the center of the title bar
CaptionButtonsPleasantCaptionButtons.TypeAllWhich caption buttons to show
IsCloseButtonVisiblebooltrueWhether the close button is visible
IsMinimizeButtonVisiblebooltrueWhether the minimize button is visible
IsRestoreButtonVisiblebooltrueWhether the restore/maximize button is visible
IsFullScreenButtonVisibleboolfalseWhether the full-screen toggle button is visible
EnableBlurboolfalseAcrylic/blur window background
SplashScreenIPleasantSplashScreennullSplash screen shown on startup

Extended title bar with custom content

<PleasantWindow TitleBarType="ClassicExtended"
                ExtendsContentIntoTitleBar="True"
                DisplayIcon="{DynamicResource MyLogo}"
                Subtitle="v2.0">
    <PleasantWindow.TitleContent>
        <TextBox PlaceholderText="Search…" Width="200" />
    </PleasantWindow.TitleContent>
    <!-- content -->
</PleasantWindow>

macOS caption buttons

Control whether to override native macOS caption buttons:

<PleasantWindow OverrideMacOSCaption="True" />

When true, the custom caption buttons are used on macOS. When false, the system traffic light buttons are shown.

Button visibility

Control individual caption button visibility:

<PleasantWindow IsCloseButtonVisible="True"
              IsMinimizeButtonVisible="True"
              IsRestoreButtonVisible="True"
              IsFullScreenButtonVisible="False" />

These properties provide fine-grained control over which caption buttons are displayed, independent of the CaptionButtons property.

Splash screen

Implement IPleasantSplashScreen and assign it before the window is shown:

public class MySplash : IPleasantSplashScreen
{
    public string? AppName => "My App";
    public IImage? AppIcon => null;
    public object? SplashScreenContent => null; // or a custom UserControl
    public IBrush? Background => null;           // null = window background
    public int MinimumShowTime => 1500;          // ms

    public async Task RunTasks(CancellationToken ct)
    {
        await LoadSettingsAsync(ct);
        await PreloadDataAsync(ct);
    }
}

public MainWindow()
{
    InitializeComponent();
    SplashScreen = new MySplash();
}

For fully custom splash content, return a Control from SplashScreenContent:

public object? SplashScreenContent => new MySplashView();