Table of Contents

Class Arc

Namespace
Wpf.Ui.Controls
Assembly
Wpf.Ui.dll

Control that draws a symmetrical arc with rounded edges.

public class Arc : Shape, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient
Inheritance
Arc
Implements
Inherited Members

Examples

<ui:Arc
    EndAngle="359"
    StartAngle="0"
    Stroke="{ui:ThemeResource SystemAccentColorSecondaryBrush}"
    StrokeThickness="2"
    Visibility="Visible" />

Fields

EndAngleProperty

Identifies the EndAngle dependency property.

public static readonly DependencyProperty EndAngleProperty

Field Value

DependencyProperty

StartAngleProperty

Identifies the StartAngle dependency property.

public static readonly DependencyProperty StartAngleProperty

Field Value

DependencyProperty

StrokeStartLineCapProperty

Identifies the StrokeStartLineCap dependency property.

public static readonly DependencyProperty StrokeStartLineCapProperty

Field Value

DependencyProperty

SweepDirectionProperty

Identifies the SweepDirection dependency property.

public static readonly DependencyProperty SweepDirectionProperty

Field Value

DependencyProperty

Properties

DefiningGeometry

Gets a value that represents the Geometry of the Shape.

protected override Geometry DefiningGeometry { get; }

Property Value

Geometry

The Geometry of the Shape.

EndAngle

Gets or sets the final angle from which the arc will be drawn.

public double EndAngle { get; set; }

Property Value

double

IsLargeArc

Gets a value indicating whether one of the two larger arc sweeps is chosen; otherwise, if is false, one of the smaller arc sweeps is chosen.

public bool IsLargeArc { get; }

Property Value

bool

StartAngle

Gets or sets the initial angle from which the arc will be drawn.

public double StartAngle { get; set; }

Property Value

double

StrokeStartLineCap

public PenLineCap StrokeStartLineCap { get; set; }

Property Value

PenLineCap

SweepDirection

Gets or sets the direction to where the arc will be drawn.

public SweepDirection SweepDirection { get; set; }

Property Value

SweepDirection

Methods

ArrangeOverride(Size)

Arranges a Shape by evaluating its RenderedGeometry and Stretch properties.

protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize Size

The final evaluated size of the Shape.

Returns

Size

The final size of the arranged Shape element.

DefinedGeometry()

Get the geometry that defines this shape.

Based on Mark Feldman implementation.

protected Geometry DefinedGeometry()

Returns

Geometry

GetVisualChild(int)

Overrides GetVisualChild(int), and returns a child at the specified index from a collection of child elements.

protected override Visual? GetVisualChild(int index)

Parameters

index int

The zero-based index of the requested child element in the collection.

Returns

Visual

The requested child element. This should not return null; if the provided index is out of range, an exception is thrown.

MeasureOverride(Size)

Measures a Shape during the first layout pass prior to arranging it.

protected override Size MeasureOverride(Size availableSize)

Parameters

availableSize Size

Returns

Size

The maximum Size for the Shape.

OnRender(DrawingContext)

Overrides the default OnRender method to draw the Arc element.

protected override void OnRender(DrawingContext drawingContext)

Parameters

drawingContext DrawingContext

A DrawingContext object that is drawn during the rendering pass of this Shape.

PointAtAngle(double)

Draws a point on the coordinates of the given angle.

Based on Mark Feldman implementation.

protected Point PointAtAngle(double angle)

Parameters

angle double

The angle at which to create the point.

Returns

Point

PropertyChangedCallback(DependencyObject, DependencyPropertyChangedEventArgs)

Event triggered when one of the key parameters is changed. Forces the geometry to be redrawn.

protected static void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)

Parameters

d DependencyObject
e DependencyPropertyChangedEventArgs