Compartilhar via


Canvas.Left Attached Property

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

Gets or sets the distance between the left side of an object and the left side of its parent Canvas.

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

Syntax

'Declaration
See GetLeft, SetLeft
See GetLeft, SetLeft
<object Canvas.Left="double"/>

Property Value

Type: System.Double
The offset position from the left side of a parent Canvas, in pixels. The default is 0.

Remarks

Dependency property identifier field: LeftProperty

Negative values are permitted. A negative value places the origin of the object where Canvas.Left is applied off-screen to the left side of the content area.

This property is an example of an attached property syntax, whereby non-Canvas objects can set this property that can then be read and interpreted by a parent Canvas. For more information about attached properties, see Attached Properties Overview.

The value is interpreted by any immediate parent Canvas. If there are nested Canvas objects, values for Canvas.Left that do not come from immediate child elements are ignored. A Canvas can itself have a Canvas.Left value, but the value does not apply on itself, rather it is interpreted by any parent Canvas, as in the nested scenario mentioned.

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.