Assembly: PresentationFramework (in PresentationFramework.dll)
This property determines the scaling restrictions that apply to the contents of a Viewbox. For example, use this property to prevent the contents of a Viewbox from being smaller or larger than its original size.
The following example shows how to create an instance of Viewbox and then set the property by using code.
// Create a Viewbox and add it to the Canvas myViewbox = new Viewbox(); myViewbox.StretchDirection = StretchDirection.Both; myViewbox.Stretch = Stretch.Fill; myViewbox.MaxWidth = 400; myViewbox.MaxHeight = 400;
Available since 3.0
Available since 4.0
Windows Phone Silverlight
Available since 7.1