Intersoft ClientUI Documentation
Viewbox Class
Members 



Defines a content decorator that can stretch and scale a single child to fill the available space.
Object Model
Viewbox ClassISFramework Class
Syntax
<ContentPropertyAttribute("Child")>
Public NotInheritable Class Viewbox 
   Inherits ViewboxInternal
   Implements Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing 
Dim instance As Viewbox
[ContentPropertyAttribute("Child")]
public sealed class Viewbox : ViewboxInternal, Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing  
[ContentPropertyAttribute("Child")]
public ref class Viewbox sealed : public ViewboxInternal, Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing  
Remarks

Viewbox is inherited from ISContentControl, which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information about this content model, see Content Model Overview.

Viewbox scales the content to fill the available size. It does not resize the content, but it transforms it. This means that also all text sizes and line widths were scaled. Its about the same behavior as if you set the Stretch property on an Image or Path to Uniform.

 

Example

The following example demonstrates the difference between each stretch mode.

XAML
Copy Code
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
    <Border BorderBrush="Black" BorderThickness="1" Padding="8" Width="150" Height="150" Margin="8">
        <Viewbox Stretch="Uniform">
            <Button Height="40" Width="80" Content="Click Me"></Button>
        </Viewbox>
    </Border>
    <Border BorderBrush="Black" BorderThickness="1" Padding="8" Width="150" Height="150" Margin="8">
        <Viewbox Stretch="Fill">
            <Button Height="40" Width="80" Content="Click Me"></Button>
        </Viewbox>
    </Border>
    <Border BorderBrush="Black" BorderThickness="1" Padding="8" Width="150" Height="150" Margin="8">
        <Viewbox Stretch="UniformToFill">
            <Button Height="40" Width="80" Content="Click Me"></Button>
        </Viewbox>
    </Border>
    <Border BorderBrush="Black" BorderThickness="1" Padding="8" Width="150" Height="150" Margin="8">
        <Viewbox Stretch="None">
            <Button Height="40" Width="80" Content="Click Me"></Button>
        </Viewbox>
    </Border>
</StackPanel>

Inheritance Hierarchy

System.Object
   System.Windows.DependencyObject
      System.Windows.UIElement
         System.Windows.FrameworkElement
            System.Windows.Controls.Control
               System.Windows.Controls.ContentControl
                  Intersoft.Client.Framework.ISContentControl
                        Intersoft.Client.UI.Controls.Viewbox

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Viewbox Members
Intersoft.Client.UI.Controls Namespace

Send Feedback