Class PaddedViewbox
This Viewbox will create a uniform padding around it's content. This behavior can be overridden by using the Sartorius.SAF.Presentation.Controls.Padding.Value, Left, Top, Right or Bottom attached properties.
Inheritance
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
[SuppressMessage("ReSharper", "LocalizableElement")]
public class PaddedViewbox : Viewbox, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild
Examples
<SAF:PaddedViewbox Padding="* 2* 0 10">
<Border Width="100" Height="50" Background="{SAF:Brush Background25}"></Border>
</SAF:PaddedViewbox>
<UserControl x:Class="Sartorius.SAF.Documentation.Examples.Controls.PaddedViewbox.PaddedViewboxExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Sartorius.SAF.Documentation.Examples.Controls.PaddedViewbox"
xmlns:SAF="http://www.sartorius.com/SAF"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Background="Black">
<!-- <Example> -->
<SAF:PaddedViewbox Padding="* 2* 0 10">
<Border Width="100" Height="50" Background="{SAF:Brush Background25}"></Border>
</SAF:PaddedViewbox>
<!-- </Example> -->
</Grid>
</UserControl>
Fields
View SourceAbsolutePaddingProperty
Identifies the DependencyProperty for the AbsolutePadding property.
Declaration
public static readonly DependencyProperty AbsolutePaddingProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PaddingProperty
Identifies the DependencyProperty for the Padding property.
Declaration
public static readonly DependencyProperty PaddingProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
PaddingReferenceProperty
Identifies the DependencyProperty for the PaddingReference property.
Declaration
public static readonly DependencyProperty PaddingReferenceProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceAbsolutePadding
Gets the current padding in absolute units.
Declaration
public Thickness AbsolutePadding { get; set; }
Property Value
| Type | Description |
|---|---|
| Thickness |
Padding
Gets or sets the padding
Declaration
public Padding Padding { get; set; }
Property Value
| Type | Description |
|---|---|
| Padding |
PaddingReference
Gets or sets the padding reference used to calculate the padding.
Declaration
public PaddingReference PaddingReference { get; set; }
Property Value
| Type | Description |
|---|---|
| PaddingReference |
Methods
View SourceArrangeOverride(Size)
Arranges the content of a Viewbox element.
Declaration
protected override Size ArrangeOverride(Size arrangeSize)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | arrangeSize | The Size this element uses to arrange its child elements. |
Returns
| Type | Description |
|---|---|
| Size | Size that represents the arranged size of this Viewbox element and its child elements. |
Overrides
View SourceMeasureOverride(Size)
Measures the child elements of a Viewbox prior to arranging them during the ArrangeOverride(Size) pass.
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | constraint |
Returns
| Type | Description |
|---|---|
| Size | The Size that represents the element size you want. |