In This Article

GaugeBase Class

Represents the base class for all Gauge controls.

public abstract class GaugeBase : GaugeElement, ILogicalParent, IVisualParent
Inheritance:
object Visual UIElement FrameworkElement GaugeElement object
Derived:
CircularGaugeBase RectangularGaugeBase
Implements:
ILogicalParent IVisualParent

Constructors

GaugeBase()

Initializes an instance of the class.

protected GaugeBase()

Properties

Background

The background brush.

public Brush? Background { get; set; }

Property Value

Brush:

The default value is Gray.

IsBackgroundEffectEnabled

Indicates whether a special effect should be rendered for the background of the gauge.

public bool IsBackgroundEffectEnabled { get; set; }

Property Value

bool:

true if the background effect is enabled; otherwise, false. The default value is true.

IsRimEffectEnabled

Indicates whether a special effect should be rendered for the rim portion of the gauge.

public bool IsRimEffectEnabled { get; set; }

Property Value

bool:

true if the rim effect is enabled; otherwise, false. The default value is true.

Items

The UIElement objects within the gauge.

public LogicalChildrenCollection<UIElement> Items { get; }

Property Value

LogicalChildrenCollection<UIElement>

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.

Origin

The origin of the X and Y coordinates, which is only used when the gauge is embedded inside another gauge. The default value is Center.

public CoordinateOrigin Origin { get; set; }

Property Value

CoordinateOrigin

RimBrush

The rim brush.

public Brush? RimBrush { get; set; }

Property Value

Brush:

The default value is DarkGray.

UnitBaseX

The base value used to convert Unit types to a double along the x-axis.

public double UnitBaseX { get; protected set; }

Property Value

double

UnitBaseY

The base value used to convert Unit types to a double along the y-axis.

public double UnitBaseY { get; protected set; }

Property Value

double

X

The X-coordinate of this gauge, which is only used when the gauge is embedded inside another gauge.

public Unit X { get; set; }

Property Value

Unit:

The default value is 0px.

Y

The Y-coordinate of this gauge, which is only used when the gauge is embedded inside another gauge.

public Unit Y { get; set; }

Property Value

Unit:

The default value is 0px.

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.

GetLocation(UIElement, Size)

Returns the location of the given element assuming the specified size.

protected virtual Point GetLocation(UIElement element, Size size)
Parameter Type Description
element UIElement

The element.

size Size

The size.

Returns

Point

GetOrigin(DependencyObject)

Returns the value of the OriginProperty attached property for a specified object.

[AttachedPropertyBrowsableForChildren(IncludeDescendants = true)]
public static CoordinateOrigin GetOrigin(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object to which the attached property is retrieved.

Returns

CoordinateOrigin

GetX(DependencyObject)

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

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

The object to which the attached property is retrieved.

Returns

Unit:

The X-coordinate value.

GetY(DependencyObject)

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

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

The object to which the attached property is retrieved.

Returns

Unit:

The Y-coordinate value.

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.

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer? OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnRenderSizeChanged(SizeChangedInfo)

Raises the SizeChanged event, using the specified information as part of the eventual event data.

protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameter Type Description
sizeInfo SizeChangedInfo

Details of the old and new size involved in the change.

SetOrigin(DependencyObject, CoordinateOrigin)

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

public static void SetOrigin(DependencyObject obj, CoordinateOrigin value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value CoordinateOrigin

The coordinate origin.

SetX(DependencyObject, Unit)

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

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

The object to which the attached property is written.

value Unit

The X-coordinate value.

SetY(DependencyObject, Unit)

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

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

The object to which the attached property is written.

value Unit

The Y-coordinate value.

ToBitmap(double, double)

Creates a BitmapSource based on the contents of the gauge.

public BitmapSource? ToBitmap(double dpiX, double dpiY)
Parameter Type Description
dpiX double

The x DPI.

dpiY double

The y DPI.

Returns

BitmapSource

UpdateUnitBases()

Updates UnitBaseX and UnitBaseY.

protected virtual void UpdateUnitBases()

Fields

BackgroundProperty

Defines the Background property.

public static readonly DependencyProperty BackgroundProperty

IsBackgroundEffectEnabledProperty

Defines the IsBackgroundEffectEnabled property.

public static readonly DependencyProperty IsBackgroundEffectEnabledProperty

IsRimEffectEnabledProperty

Defines the IsRimEffectEnabled property.

public static readonly DependencyProperty IsRimEffectEnabledProperty

OriginProperty

Defines the Origin property.

public static readonly DependencyProperty OriginProperty

RimBrushProperty

Defines the RimBrush property.

public static readonly DependencyProperty RimBrushProperty

UnitBaseXProperty

Defines the read-only UnitBaseX property.

public static readonly DependencyProperty UnitBaseXProperty

UnitBaseYProperty

Defines the read-only UnitBaseY property.

public static readonly DependencyProperty UnitBaseYProperty

XProperty

Defines the X property.

public static readonly DependencyProperty XProperty

YProperty

Defines the Y property.

public static readonly DependencyProperty YProperty

Inherited Members

Extension Methods