XamlTemplates.FX.Wpf
1.0.0-preview.5
dotnet add package XamlTemplates.FX.Wpf --version 1.0.0-preview.5
NuGet\Install-Package XamlTemplates.FX.Wpf -Version 1.0.0-preview.5
<PackageReference Include="XamlTemplates.FX.Wpf" Version="1.0.0-preview.5" />
<PackageVersion Include="XamlTemplates.FX.Wpf" Version="1.0.0-preview.5" />
<PackageReference Include="XamlTemplates.FX.Wpf" />
paket add XamlTemplates.FX.Wpf --version 1.0.0-preview.5
#r "nuget: XamlTemplates.FX.Wpf, 1.0.0-preview.5"
#:package XamlTemplates.FX.Wpf@1.0.0-preview.5
#addin nuget:?package=XamlTemplates.FX.Wpf&version=1.0.0-preview.5&prerelease
#tool nuget:?package=XamlTemplates.FX.Wpf&version=1.0.0-preview.5&prerelease
XamlTemplates.FX.Wpf
Live GPU glass and desktop effects for ordinary WPF windows.
Install
dotnet add package XamlTemplates.FX.Wpf --version 1.0.0-preview.5
The initial preview requires .NET 10, Windows 10 version 2004 (build 19041) or later, and an x64 process.
Use it
Attach the effect directly to an existing Window; no custom base class or code-behind is required:
Required for the current WPF preview: explicitly set AllowsTransparency="True", WindowStyle="None", and an initial Background="Transparent" on the Window itself, not just its child Grid. These settings apply to both built-in effects and custom GLSL shaders. Glass.IsEnabled does not set them automatically.
<Window
x:Class="MyApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fx="clr-namespace:XamlTemplates.FX.Wpf;assembly=XamlTemplates.FX.Wpf"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
fx:Glass.IsEnabled="True">
<Grid Background="Transparent" />
</Window>
WPF requires WindowStyle="None" when AllowsTransparency="True"; otherwise the window fails at startup. This removes the native title bar and caption buttons. Use WPF WindowChrome and application-owned caption buttons for borderless dragging, resizing, minimize, maximize, and close, as shown in the WPF sample.
The SDK replaces the initial window background with its captured/shaded image or a readable fallback brush. Keep application content transparent or translucent where that image should remain visible; an opaque root panel covers the effect.
If the background is black or opaque, check these Window settings first. Transparency alone does not prove that capture or the shader is running: also inspect Glass.RuntimeState, Glass.LastError, and Glass.Diagnostics if the effect remains missing.
Liquid Glass is the default. Glass.Effect also accepts bindable VHS, Lake Ice, Aurora Curtain, Black Hole, Heat Mirage, and Crackle Glaze effects. An optional bindable spherical-surface modifier can wrap any effect.
Screen-recording support
Version 1.0.0-preview.5 adds opt-in selected-window capture so the glass window
can appear in compatible screen recordings. Normal desktop capture remains the
default; applications explicitly choose a source to enable recording mode.
Normal desktop mode excludes the glass window from compatible screen recorders to avoid capturing its own rendered background. To record the complete glass window, explicitly select a different application's visible top-level HWND:
<Window ...
WindowStyle="None" AllowsTransparency="True" Background="Transparent"
fx:Glass.IsEnabled="True"
fx:Glass.CaptureSourceWindow="{Binding SelectedSourceHwnd}">
...
</Window>
The equivalent core option is GlassOptions.CaptureSourceWindow. IntPtr.Zero
uses desktop capture; a nonzero HWND uses Windows Graphics Capture for that
window and makes the glass host recordable. This input works with both built-in
effects and external GLSL. Only the selected window is sampled, aligned to its
physical desktop position—not stretched to fill the glass. Uncovered areas use
neutral #20242A padding. Maximize the source behind the demo for best coverage.
The SDK does not record video; use your screen recorder after enabling this
mode. No source is automatically selected. Minimized, hidden, or closed sources
produce fallback/status (Glass.LastError, Glass.Diagnostics.UsingFallback)
without reverting to desktop capture. Restore the source or choose another;
toggle the mode off/on to retry a failed session. Own-process/child windows are
rejected. Windows capture protection and the OS capture indicator are respected;
protected video may remain blank. A host with pre-existing capture protection
cannot enter this mode. Normal disposal restores the host's prior affinity.
Changes in 1.0.0-preview.5
Added Glass.CaptureSourceWindow and GlassOptions.CaptureSourceWindow for
selected-window capture with Windows Graphics Capture. The selected background
window stays aligned in desktop coordinates, with neutral padding outside its
bounds. Source loss reports a fallback without switching to desktop capture.
The existing desktop mode, shader parameters, and built-in shader assets are
unchanged. The library supplies the backdrop; a separate screen recorder records
the resulting application window.
Changes in 1.0.0-preview.4
Corrected the WPF setup documentation: the Window must explicitly use AllowsTransparency="True", WindowStyle="None", and an initial transparent background. Added troubleshooting guidance for black or opaque backgrounds. This is a documentation release; the runtime and built-in shader behavior are unchanged from preview.3.
Changes in 1.0.0-preview.3
The built-in Liquid Glass now uses beveled-sheet refraction that follows the rounded window boundary, with restrained color dispersion and directional shine. It retains the existing parameter names, ranges, and defaults, but its appearance differs from earlier previews. Its aperture filter uses at most 21 texture samples per covered pixel instead of 75; this is not a measured frame-rate improvement. Manually loaded GLSL shaders keep their own implementation and are unaffected.
Custom GLSL
Ship a trusted GLSL ES 3.0 fragment shader as an application asset:
<ItemGroup>
<XamlTemplatesFxShader Include="Shaders\MyGlass.glsl" />
</ItemGroup>
<fx:Glass.Effect>
<fx:GlslShaderEffect Source="Shaders/MyGlass.glsl"
ReloadOnChange="True">
<fx:GlslParameter Name="blurIntensity" Value="1.2" />
<fx:GlslParameter Name="tint" Value="#80C8E8FF" />
</fx:GlslShaderEffect>
</fx:Glass.Effect>
Shaders receive WebGL-style uv, u_resolution, u_mouse, u_time, and captured pixels in u_textures[0]. Custom uniforms support float, int, uint, bool, vec2, vec3, vec4, and Color values. Compilation is asynchronous; ReloadOnChange keeps the last good shader active if an edit fails. Use it for trusted application shaders, not downloaded or otherwise untrusted content.
If capture, the GPU, or the WPF front buffer is unavailable, the window uses a readable fallback brush. Applications can inspect Glass.RuntimeState, Glass.LastError, and Glass.Diagnostics.
Examples and documentation: https://github.com/dragosniamtu/WPF-Liquid-Glass-Effect
License
The package is proprietary but free for personal and commercial application use under the included XamlTemplates FX Community Binary License 1.0. Redistribution is permitted only as the inseparable runtime portion of an application; standalone redistribution and competing SDK use are restricted. Review LICENSE-BINARY.md before use.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.19041 is compatible. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.5 | 68 | 9/27/2026 |
| 1.0.0-preview.4 | 50 | 9/26/2026 |
| 1.0.0-preview.3 | 68 | 9/13/2026 |
| 1.0.0-preview.1 | 58 | 9/12/2026 |