Skip to content

OverlayLayer class

Window-level overlay layer for elements that render on top of normal content but are positioned relative to the window (not a specific element). Examples: toast notifications, progress rings, dim backgrounds. Overlays render in insertion order (later = on top).

Guide: C# Markup guide

public sealed class OverlayLayer
name description
Count { get; } Gets the number of active overlays.
Add(…) Adds an overlay. Later-added overlays render on top.
Contains(…) Checks whether the specified overlay is currently in this layer.
GetOrCreateService<T>(…) Gets a registered service, creating it with the factory if not yet registered. The factory receives this OverlayLayer so the service can manage its own presenter controls.
GetService<T>() Gets a registered service, or null if not registered.
RegisterService<T>(…) Registers (or replaces) a service of the given type.
Remove(…) Removes a previously added overlay.