Canvas.Top attached property

Applies to Windows and Windows Phone

Gets or sets the distance between the top of an element and the top of its parent Canvas.


<object Canvas.Top="offset"/>

XAML Values

offset

The vertical offset between the top edge of the parent Canvas, and where the target element should be placed. You typically specify positive integer numbers. Non-integer Double values are allowed but can potentially cause subpixel rendering issues; see UseLayoutRounding.

Remarks

Canvas.Top is an attached property, which supports a XAML usage. When setting this property in code, use SetTop instead. When getting this property in code, use GetTop instead. In code usages, the target parameter is the object where the attached property value is set. Another way to get or set the value in code is to use the dependency property system, calling either GetValue or SetValue and passing TopProperty as the dependency property identifier.

A Canvas.Top value is interpreted by the most immediate parent Canvas element from where the value is set. The value is used along with Canvas.Left to specify the layout characteristics of each child element of a Canvas.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls

Metadata

Windows.winmd

See also

Canvas
Attached properties overview
Quickstart: Defining layouts

 

 

Show:
© 2014 Microsoft