Table of Contents

Class LayeredPanel

Namespace
PluginUI
Assembly
PluginUI.dll

Stack of full-size layers drawn on top of each other (VSTGUI CLayeredViewContainer): backgrounds, a control layer, an overlay page that fades in, a modulation layer… Every child fills the panel (minus its Margin, with its alignment), the last child is on top, and layer opacity is composited properly (a half-transparent layer does not reveal the overlaps of its own children).

public class LayeredPanel : Panel
Inheritance
LayeredPanel
Inherited Members

Examples

var layers = new LayeredPanel();
layers.Add(background, controls, overlay);
overlay.Opacity = 0f;                       // hidden page
host.Animator.Animate(0, 1, 0.25, v => overlay.Opacity = (float)v);
layers.BringToFront(controls);

Properties

CompositeLayers

Composites the opacity of each layer through an offscreen layer (default true).

public bool CompositeLayers { get; set; }

Property Value

bool

Methods

ArrangeOverride(Rect)

Arranges children inside the final bounds.

protected override void ArrangeOverride(Rect bounds)

Parameters

bounds Rect

BringToFront(UIElement)

Moves a layer to the top (drawn last, first hit).

public void BringToFront(UIElement layer)

Parameters

layer UIElement

A child of this panel.

Exceptions

ArgumentException

layer is not a child of this panel.

MeasureOverride(Size)

Natural size of the content for the available size (margins excluded).

protected override Size MeasureOverride(Size available)

Parameters

available Size

Returns

Size

SendToBack(UIElement)

Moves a layer to the bottom (drawn first).

public void SendToBack(UIElement layer)

Parameters

layer UIElement

A child of this panel.

Exceptions

ArgumentException

layer is not a child of this panel.