In This Article

LinearScale Class

Represents a scale for use in a LinearGauge.

public class LinearScale : ScaleBase, ILogicalParent, IVisualParent, IOrientedElement
Inheritance:
object Visual UIElement FrameworkElement GaugeElement ScaleBase object
Implements:
ILogicalParent IVisualParent IOrientedElement

Constructors

LinearScale()

Initializes an instance of the class.

public LinearScale()

Properties

BarAscent

The ascent of the bar.

public Unit BarAscent { get; set; }

Property Value

Unit:

The default value is 5 pixels.

LogicalChildren

Gets an enumerator for logical child elements of this element.

protected override IEnumerator? LogicalChildren { get; }

Property Value

IEnumerator:

An enumerator for logical child elements of this element.

Orientation

The orientation of this element, which is inherited/set via an attached property on LinearGauge.

protected Orientation Orientation { get; }

Property Value

Orientation

TickSets

The tick-set elements within the scale.

public LinearTickSetCollection TickSets { get; }

Property Value

LinearTickSetCollection

Methods

ArrangeOverride(Size)

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

GetBarAscent(DependencyObject)

Gets the value of the BarAscentProperty attached property for a specified object.

[AttachedPropertyBrowsableForChildren(IncludeDescendants = true)]
public static Unit GetBarAscent(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object to which the attached property is retrieved.

Returns

Unit:

The bar ascent.

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

OnRender(DrawingContext)

When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

protected override void OnRender(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The drawing instructions for a specific element. This context is provided to the layout system.

SetBarAscent(DependencyObject, Unit)

Sets the value of the BarAscentProperty attached property to a specified object.

public static void SetBarAscent(DependencyObject obj, Unit value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value Unit

The value to assign.

Fields

BarAscentProperty

Defines the BarAscent property.

public static readonly DependencyProperty BarAscentProperty

Inherited Members

Extension Methods