Udostępnij za pośrednictwem


TileBrush.Stretch Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a value that specifies how the content of this TileBrush stretches to fit its tiles.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property Stretch As Stretch
public Stretch Stretch { get; set; }
<brush Stretch="stretchValue"/>

XAML Values

  • stretchValue
    A named constant of the Stretch enumeration, such as Fill.

Property Value

Type: System.Windows.Media.Stretch
A value that specifies how this TileBrush content is projected onto its base tile. The default value is Fill.

Remarks

Dependency property identifier field: StretchProperty

The Stretch property accepts the following values, which the Stretch enumeration defines:

  • None: The TileBrush content does not stretch to fill the tile.

  • Uniform: The TileBrush content is scaled to fit the tile dimensions. However, the aspect ratio of the content is preserved.

  • UniformToFill: The TileBrush content is scaled so that it completely fills the output area but preserves its original aspect ratio.

  • Fill: The TileBrush content is scaled to fit the tile. Because the content's height and width are scaled independently, the original aspect ratio of the content might not be preserved. That is, the TileBrush content might be distorted in order to completely fill the output tile.

The following image illustrates the different Stretch settings.

Different stretch settings

Different TileBrush Stretch settings

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.