Show / Hide Table of Contents

Class Shape

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

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Shape
Ellipse
Line
Path
Polygon
Polyline
Rectangle
Inherited Members
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.LogicalChildren
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.OnApplyTemplate()
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.ManageIsEnabled(Boolean)
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.OnGotFocus(RoutedEventArgs)
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Shapes
Assembly: OpenSilver.dll
Syntax
public abstract class Shape : FrameworkElement, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

Shape()

Initializes a new instance of the Shape class.

Declaration
protected Shape()

Fields

| Improve this Doc View Source

FillProperty

Identifies the Fill dependency property.

Declaration
public static readonly DependencyProperty FillProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StretchProperty

Identifies the Stretch dependency property.

Declaration
public static readonly DependencyProperty StretchProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeDashArrayProperty

Identifies the StrokeDashArray dependency property.

Declaration
public static readonly DependencyProperty StrokeDashArrayProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeDashCapProperty

Identifies the StrokeDashCap dependency property.

Declaration
public static readonly DependencyProperty StrokeDashCapProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeDashOffsetProperty

Identifies the StrokeDashOffset dependency property.

Declaration
public static readonly DependencyProperty StrokeDashOffsetProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeEndLineCapProperty

Identifies the StrokeEndLineCap dependency property.

Declaration
[NotImplemented]
public static readonly DependencyProperty StrokeEndLineCapProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeLineJoinProperty

Identifies the StrokeLineJoin dependency property.

Declaration
public static readonly DependencyProperty StrokeLineJoinProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeMiterLimitProperty

Identifies the StrokeMiterLimit dependency property.

Declaration
public static readonly DependencyProperty StrokeMiterLimitProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeProperty

Identifies the Stroke dependency property.

Declaration
public static readonly DependencyProperty StrokeProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeStartLineCapProperty

Identifies the StrokeStartLineCap dependency property.

Declaration
[NotImplemented]
public static readonly DependencyProperty StrokeStartLineCapProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

StrokeThicknessProperty

Identifies the StrokeThickness dependency property.

Declaration
public static readonly DependencyProperty StrokeThicknessProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

Fill

Gets or sets the Brush that specifies how to paint the interior of the shape.

Declaration
public Brush Fill { get; set; }
Property Value
Type Description
Brush

A Brush that describes how the shape's interior is painted. The default is null.

| Improve this Doc View Source

GeometryTransform

Gets a value that represents a Transform that is applied to the geometry of a Shape prior to when it is drawn.

Declaration
public virtual Transform GeometryTransform { get; }
Property Value
Type Description
Transform

A Transform that is applied to the geometry of a Shape prior to when it is drawn.

| Improve this Doc View Source

Stretch

Gets or sets a Stretch enumeration value that describes how the shape fills its allocated space.

Declaration
public Stretch Stretch { get; set; }
Property Value
Type Description
Stretch

One of the Stretch enumeration values. The default value at run time depends on the type of Shape.

| Improve this Doc View Source

Stroke

Gets or sets the Brush that specifies how the Shape outline is painted.

Declaration
public Brush Stroke { get; set; }
Property Value
Type Description
Brush

A Brush that specifies how the Shape outline is painted. The default is null.

| Improve this Doc View Source

StrokeDashArray

Gets or sets a collection of System.Double values that indicate the pattern of dashes and gaps that is used to outline shapes.

Declaration
public DoubleCollection StrokeDashArray { get; set; }
Property Value
Type Description
DoubleCollection

A collection of System.Double values that specify the pattern of dashes and gaps.

| Improve this Doc View Source

StrokeDashCap

Gets or sets a PenLineCap enumeration value that specifies how the ends of a dash are drawn.

Declaration
public PenLineCap StrokeDashCap { get; set; }
Property Value
Type Description
PenLineCap

One of the enumeration values for PenLineCap. The default is Flat.

| Improve this Doc View Source

StrokeDashOffset

Gets or sets a System.Double that specifies the distance within the dash pattern where a dash begins.

Declaration
public double StrokeDashOffset { get; set; }
Property Value
Type Description
System.Double

A System.Double that represents the distance within the dash pattern where a dash begins. The default value is 0.

| Improve this Doc View Source

StrokeEndLineCap

Gets or sets a PenLineCap enumeration value that describes the Shape at the end of a line.

Declaration
[NotImplemented]
public PenLineCap StrokeEndLineCap { get; set; }
Property Value
Type Description
PenLineCap

One of the enumeration values for PenLineCap. The default is Flat.

| Improve this Doc View Source

StrokeLineJoin

Gets or sets a PenLineJoin enumeration value that specifies the type of join that is used at the vertices of a Shape.

Declaration
public PenLineJoin StrokeLineJoin { get; set; }
Property Value
Type Description
PenLineJoin

A value of the PenLineJoin enumeration that specifies the join appearance. The default value is Miter.

| Improve this Doc View Source

StrokeMiterLimit

Gets or sets a limit on the ratio of the miter length to half the StrokeThickness of a Shape element.

Declaration
public double StrokeMiterLimit { get; set; }
Property Value
Type Description
System.Double

The limit on the ratio of the miter length to the StrokeThickness of a Shape element. This value is always a positive number that is greater than or equal to 1.

| Improve this Doc View Source

StrokeStartLineCap

Gets or sets a PenLineCap enumeration value that describes the Shape at the start of a Stroke.

Declaration
[NotImplemented]
public PenLineCap StrokeStartLineCap { get; set; }
Property Value
Type Description
PenLineCap

A value of the PenLineCap enumeration that specifies the shape at the start of a Stroke. The default is Flat.

| Improve this Doc View Source

StrokeThickness

Gets or sets the width of the Shape stroke outline.

Declaration
public double StrokeThickness { get; set; }
Property Value
Type Description
System.Double

The width of the Shape outline, in pixels. The default value is 0.

Methods

| Improve this Doc View Source

ArrangeOverride(Size)

Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type Name Description
Size finalSize
Returns
Type Description
Size
Overrides
FrameworkElement.ArrangeOverride(Size)
| Improve this Doc View Source

CreateDomElement(Object, out Object)

Declaration
public sealed override object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type Name Description
System.Object parentRef
System.Object domElementWhereToPlaceChildren
Returns
Type Description
System.Object
Overrides
FrameworkElement.CreateDomElement(Object, out Object)
| Improve this Doc View Source

INTERNAL_OnDetachedFromVisualTree()

Declaration
protected sealed override void INTERNAL_OnDetachedFromVisualTree()
Overrides
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
| Improve this Doc View Source

MeasureOverride(Size)

Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type Name Description
Size constraint
Returns
Type Description
Size
Overrides
FrameworkElement.MeasureOverride(Size)

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source