C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Fill: This means that the internal element within the Viewbox should be expanded as far as possible in both directions. Ratios are ignored.
Uniform: The element is expanded so that its ratios are preserved, as far as possible. The control is not cropped.
UniformToFill: This expands the control until it fills the entire Viewbox. Cropping may occur.
Tip: When using a Viewbox, I recommend trying all the Stretch options to find the best one for your purpose.
Example markup: XAML
<Window x:Class="WpfApplication10.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Viewbox HorizontalAlignment="Left" Height="299"
Margin="10,10,0,0" VerticalAlignment="Top" Width="497"
Stretch="Fill">
<TextBox Height="23" TextWrapping="Wrap" Text="TextBox" Width="120"/>
</Viewbox>
</Grid>
</Window>