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
Remarks
For detailed documentation on this control's features and how to use them, please see the Gauge documentation topics.
Constructors
GaugeBase()
Initializes a new instance of the GaugeBase class.
protected GaugeBase()
Properties
Background
Gets or sets the background brush. This is a dependency property.
public Brush Background { get; set; }
Property Value
- Brush:
The background brush.. The default value is
Gray
.
IsBackgroundEffectEnabled
Gets and sets a value indicating whether a special effect should be rendered for the background of the gauge. This is a dependency property.
public bool IsBackgroundEffectEnabled { get; set; }
Property Value
- bool:
true
if the background effect is enabled; otherwise,false
. The default value istrue
.
IsRimEffectEnabled
Gets and sets a value indicating whether a special effect should be rendered for the rim portion of the gauge. This is a dependency property.
public bool IsRimEffectEnabled { get; set; }
Property Value
- bool:
true
if the rim effect is enabled; otherwise,false
. The default value istrue
.
Items
Gets the UIElement objects within the gauge.
public LogicalChildrenCollection<UIElement> Items { get; }
Property Value
- LogicalChildrenCollection<UIElement>:
The items.
LogicalChildren
Gets an enumerator for logical child elements of this element.
Origin
Gets or sets the origin of the X and Y coordinates, which is only used when the gauge is embedded inside another gauge. This is a dependency property.
public CoordinateOrigin Origin { get; set; }
Property Value
- CoordinateOrigin:
The coordinate origin. The default value is Center.
RimBrush
Gets or sets the rim brush. This is a dependency property.
public Brush RimBrush { get; set; }
Property Value
- Brush:
The rim brush. The default value is
DarkGray
.
UnitBaseX
Gets or sets the base value used to convert Unit types to a double
along the x-axis.
This is a dependency property.
public double UnitBaseX { get; protected set; }
Property Value
UnitBaseY
Gets or sets the base value used to convert Unit types to a double
along the y-axis.
This is a dependency property.
public double UnitBaseY { get; protected set; }
Property Value
X
Gets or sets the X-coordinate of this gauge, which is only used when the gauge is embedded inside another gauge. This is a dependency property.
Y
Gets or sets the Y-coordinate of this gauge, which is only used when the gauge is embedded inside another gauge. This is a dependency property.
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)
Gets 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)
Gets 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:
The coordinate origin.
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()
Creates an appropriate GaugeBaseAutomationPeer for this control as part of the WPF infrastructure.
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:
The BitmapSource that was created.
UpdateUnitBases()
protected virtual void UpdateUnitBases()
Fields
BackgroundProperty
Identifies the Background dependency property. This field is read-only.
public static readonly DependencyProperty BackgroundProperty
IsBackgroundEffectEnabledProperty
Identifies the IsBackgroundEffectEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsBackgroundEffectEnabledProperty
IsRimEffectEnabledProperty
Identifies the IsRimEffectEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsRimEffectEnabledProperty
OriginProperty
Identifies the Origin dependency property. This field is read-only.
public static readonly DependencyProperty OriginProperty
RimBrushProperty
Identifies the RimBrush dependency property. This field is read-only.
public static readonly DependencyProperty RimBrushProperty
UnitBaseXProperty
Identifies the read-only UnitBaseX dependency property. This field is read-only.
public static readonly DependencyProperty UnitBaseXProperty
UnitBaseYProperty
Identifies the read-only UnitBaseY dependency property. This field is read-only.
public static readonly DependencyProperty UnitBaseYProperty
XProperty
Identifies the X dependency property. This field is read-only.
public static readonly DependencyProperty XProperty
YProperty
Identifies the Y dependency property. This field is read-only.
public static readonly DependencyProperty YProperty