Skip to content

Viewbox class

Scales a single child to fill this element, as WPF Viewbox does: the child is measured at its natural size and drawn scaled by Stretch and StretchDirection, centered in this element. Hit testing and coordinate conversion follow the scale.

Guide: C# Markup guide

public sealed class Viewbox : FrameworkElement, IVisualTreeHost
name description
Viewbox() The default constructor.
Child { get; set; } Gets or sets the child element.
Stretch { get; set; } Gets or sets how the child is scaled to fill this element; the default is Uniform.
StretchDirection { get; set; } Gets or sets whether the scale may enlarge the child, shrink it, or both; the default is Both.
static readonly ChildProperty
static readonly StretchDirectionProperty
static readonly StretchProperty