Compartir a través de


Shape

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

Provides a base class for shape elements, such as the Ellipse, Polygon, and Rectangle objects.

Syntax Notes

See Derived Objects for syntax information.

Derived Objects

Ellipse, Line, Path, Polygon, Polyline, Rectangle

Properties

Canvas.Left, Canvas.Top, Canvas.ZIndex, Clip, Cursor, Effect (Silverlight 3), Fill (Shape), Grid.Column (Silverlight 2), Grid.ColumnSpan (Silverlight 2), Grid.Row (Silverlight 2), Grid.RowSpan (Silverlight 2), Height (UIElement), HorizontalAlignment (Silverlight 2), Margin (Silverlight 2), MaxHeight (Silverlight 2), MaxWidth (Silverlight 2), MinHeight (Silverlight 2), MinWidth (Silverlight 2), Name (DependencyObject), Opacity (UIElement), OpacityMask, Projection (Silverlight 3), RenderTransform, RenderTransformOrigin, Resources, Stretch (Shape), Stroke (Shape), StrokeDashArray, StrokeDashCap, StrokeDashOffset, StrokeEndLineCap, StrokeLineJoin, StrokeMiterLimit, StrokeStartLineCap, StrokeThickness, Style (Silverlight 2), Tag, Triggers, VerticalAlignment (Silverlight 2), Visibility, Width (UIElement)

Managed Equivalent

Shape

Remarks

Shape is abstract, and it is not returned as that object type by any JavaScript APIs for Silverlight. You also cannot create a true Shape in XAML. For this reason, Shape is not listed in the "Applies To" lists for various UIElement APIs, even though Shape is technically an intermediate class between UIElement and derived shapes such as a Rectangle object. Shape is also not listed in the "Applies To" lists for APIs that Shape itself defines, again because it is abstract and those APIs can be used only on a practical derived class.

The Path object is a shape, but rather than being defined by discrete properties, the shape of a path is defined either as a geometry provided to the Data property, or through a Path mini-language.

For more information on basic concepts, see Shapes and Drawing. Note that the Shapes and Drawing topic is written primarily for users of the managed API, and may not have code examples or specific information that address the JavaScript API scenarios.

See Also

Reference