Class GaugeBase
Contains all the basic brushes, styles and adorner used by the Gauges. This class is derived from the System.Windows.Controls.Control class
Implements
Namespace: Syncfusion.Windows.Gauge
Assembly: Syncfusion.Gauge.WPF.dll
Syntax
public class GaugeBase : Control, IDisposable
Remarks
This class is the base class for all the controls such as CircularGauge, LinearGauge and DigitalGauge.
Constructors
GaugeBase()
Initializes a new instance of the GaugeBase class.
Declaration
public GaugeBase()
Fields
ApplyFrameStylesProperty
Identifies the ApplyFrameStyles dependency property.
Declaration
public static readonly DependencyProperty ApplyFrameStylesProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
CenterFrameFillColorProperty
Identifies the CenterFrameFillColor dependency property.
Declaration
public static readonly DependencyProperty CenterFrameFillColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
CornerRadiusProperty
Identifies the CornerRadius dependency property.
Declaration
public static readonly DependencyProperty CornerRadiusProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
EnableEffectsProperty
Identifies the EnableEffects dependency property.
Declaration
public static readonly DependencyProperty EnableEffectsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FirstFrameFillColorProperty
Identifies the CenterFrameFillColor dependency property.
Declaration
public static readonly DependencyProperty FirstFrameFillColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FirstFrameStyleProperty
Identifies the FirstFrameStyle dependency property.
Declaration
public static readonly DependencyProperty FirstFrameStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FirstFrameThicknessProperty
Identifies the Syncfusion.Windows.Gauge.GaugeBase.InnerFrameBrush dependency property.
Declaration
public static readonly DependencyProperty FirstFrameThicknessProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
InnerFrameContentProperty
Identifies the InnerFrameContent dependency property.
Declaration
public static readonly DependencyProperty InnerFrameContentProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
InnerFrameStyleProperty
Identifies the InnerFrameStyle dependency property.
Declaration
public static readonly DependencyProperty InnerFrameStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsColorMergeWithBaseProperty
Identifies the IsColorMergeWithBase dependency property.
Declaration
public static readonly DependencyProperty IsColorMergeWithBaseProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SecondFrameFillColorProperty
Identifies the CenterFrameFillColor dependency property.
Declaration
public static readonly DependencyProperty SecondFrameFillColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SecondFrameStyleProperty
Identifies the SecondFrameStyle dependency property.
Declaration
public static readonly DependencyProperty SecondFrameStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SecondFrameThicknessProperty
Identifies the Syncfusion.Windows.Gauge.GaugeBase.InnerFrameBrush dependency property.
Declaration
public static readonly DependencyProperty SecondFrameThicknessProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SizeToContainerProperty
Identifies the SizeToContainer dependency property.
Declaration
public static readonly DependencyProperty SizeToContainerProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
StateIndicatorStyleProperty
Identifies the StateIndicatorStyle dependency property.
Declaration
public static readonly DependencyProperty StateIndicatorStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
ApplyFrameStyles
Gets or sets a value indicating whether to apply custom styles. This is a dependency property.
Declaration
public bool ApplyFrameStyles { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Type: System.Boolean Default value is false. |
CenterFrameFillColor
Gets or sets the color used for drawing the inner frame. This is a dependency property.
Declaration
public Brush CenterFrameFillColor { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | Type: System.Windows.Media.Color Default value is Color.FromRgb( 69, 129, 239 ). |
See Also
CornerRadius
Gets or sets the gauge's corner radius . This is a dependency property.
Declaration
public CornerRadius CornerRadius { get; set; }
Property Value
Type |
---|
System.Windows.CornerRadius |
CustomLabels
Gets or sets the collection of custom labels.
Declaration
public CustomLabelsCollection CustomLabels { get; set; }
Property Value
Type | Description |
---|---|
CustomLabelsCollection | Type: CustomLabelsCollection |
See Also
EnableEffects
Gets or sets a value indicating whether the colors applied to the frame fill colors should be merged. Default is true. This is a dependency property.
Declaration
public bool EnableEffects { get; set; }
Property Value
Type |
---|
System.Boolean |
FirstFrameFillColor
Gets or sets the color used for drawing the outer frame. This is a dependency property.
Declaration
public Brush FirstFrameFillColor { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | Type: System.Windows.Media.Color Default value is Color.FromRgb( 69, 129, 239 ). |
See Also
FirstFrameStyle
Gets or sets the style of the first frame. This is a dependency property.
Declaration
public Style FirstFrameStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | Type: System.Windows.Style |
FirstFrameThickness
Gets or sets the first frame thickness of the gauge. This is a dependency property.
Declaration
public Thickness FirstFrameThickness { get; set; }
Property Value
Type |
---|
System.Windows.Thickness |
GaugeAdorner
Gets or sets the GaugeAdorner.
Declaration
public GaugeAdorner GaugeAdorner { get; set; }
Property Value
Type |
---|
GaugeAdorner |
Images
Gets or sets the collection of images.
Declaration
public ImagesCollection Images { get; set; }
Property Value
Type | Description |
---|---|
ImagesCollection | Type: ImagesCollection |
See Also
InnerFrameContent
Gets or sets the the inner frame content to host any content inside the gauge. This content will be added as inner frame content.
Declaration
public object InnerFrameContent { get; set; }
Property Value
Type | Description |
---|---|
System.Object | Type: System.Object Default value is null. |
InnerFrameStyle
Gets or sets the style of the inner frame. This is a dependency property.
Declaration
public Style InnerFrameStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | Type: System.Windows.Style |
IsColorMergeWithBase
Gets or sets a value indicating whether the colors applied to the frame fill colors should be merged. Default is true. This is a dependency property.
Declaration
public bool IsColorMergeWithBase { get; set; }
Property Value
Type |
---|
System.Boolean |
SecondFrameFillColor
Gets or sets the color used for drawing of SecondFrame color. This is a dependency property.
Declaration
public Brush SecondFrameFillColor { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | Type: System.Windows.Media.Color Default value is Color.FromRgb( 69, 129, 239 ). |
See Also
SecondFrameStyle
Gets or sets the style of the second frame. This is a dependency property.
Declaration
public Style SecondFrameStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | Type: System.Windows.Style |
SecondFrameThickness
Gets or sets the second frame thickness of the gauge. This is a dependency property.
Declaration
public Thickness SecondFrameThickness { get; set; }
Property Value
Type |
---|
System.Windows.Thickness |
SizeToContainer
Gets or sets a value indicating whether gauge control should fit within its container. Default is false. This is a dependency property.
Declaration
public bool SizeToContainer { get; set; }
Property Value
Type |
---|
System.Boolean |
StateIndicators
Gets or sets the collection of state indicators.
Declaration
public StateIndicatorsCollection StateIndicators { get; set; }
Property Value
Type | Description |
---|---|
StateIndicatorsCollection |
See Also
StateIndicatorStyle
StateIndicatorStyle
Declaration
public Style StateIndicatorStyle { get; set; }
Property Value
Type |
---|
System.Windows.Style |
Methods
ArrangeOverride(Size)
Called to arrange and size the content of a control.
Declaration
protected override Size ArrangeOverride(Size arrangeBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | arrangeBounds | The computed size that is used to arrange the content. |
Returns
Type | Description |
---|---|
System.Windows.Size | The size of the control. |
ChildLocationChanged(DependencyObject, DependencyPropertyChangedEventArgs)
Invoked when LocationProperty property of a child is changed.
Declaration
protected void ChildLocationChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | sender | The CircularGauge object. |
System.Windows.DependencyPropertyChangedEventArgs | e | The System.Windows.DependencyPropertyChangedEventArgs that contains the event data. |
CollectionChanged(Object, NotifyCollectionChangedEventArgs)
Occurs when an item is added, removed, changed, moved, or the entire collection is refreshed.
Declaration
protected virtual void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The source of the event. |
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains the event data. |
ConvertLocation(Point)
Converts point from range (0,0)-(100,100) to control bounds.
Declaration
protected virtual Point ConvertLocation(Point p)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | p | Point to convert. |
Returns
Type | Description |
---|---|
System.Windows.Point | Converted point. |
ConvertLocation(Point, Double, Double)
Converts Logical bounds of range [0 - 100](as perceived by the user),
to Actual control bounds with starting position as Center of the Gauge.
Declaration
protected virtual Point ConvertLocation(Point p, double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Point | p | Logical Point to convert. |
System.Double | width | Width of the gauge. |
System.Double | height | Height of the gauge. |
Returns
Type | Description |
---|---|
System.Windows.Point | Converted point. |
Remarks
This method needs to calculate the ratio of logical point "p" to that of 100(the maximum logical width/height possible) and multiply the ratio to that of the ActualWidth or ActualHeight as required, and hence get the point "p" converted to Control bounds. But since we calculate actual control bounds with the Center of Gauge as origin, we need to calculate the ratio, with respect to that of 50(i.e half of the logical maximum width/height possible) rather than to that of 100. For that, we need to bring the logical point "p" to values lesser than or equal to 50 and then calculate the ratio. If logical point "p" given by the user is greater than "50", multiplying the ratio(calculated with 50 deducted logical point) with actual width or height / 2 will suffice.If the logical point given by the user is lesser than 50, we need to subtract the result by half of the actual width/height as required.Hence get the Logical bounds converted to Actual actual with Center of gauge as the origin.
Dispose()
Declaration
public void Dispose()
GaugeBaseLoaded(Object, RoutedEventArgs)
Invoked when the control is ready for presentation.
Declaration
protected virtual void GaugeBaseLoaded(object sender, RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The source of the event. |
System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs that contains the event data. |
OnAdornerStyleChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises AdornerStyleChanged event.
Declaration
protected virtual void OnAdornerStyleChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnApplyFrameStylesChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises UseFrameStylesChanged event.
Declaration
protected virtual void OnApplyFrameStylesChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnApplyTemplate()
Builds the current template's visual tree if necessary.
Declaration
public override void OnApplyTemplate()
OnEnableEffectsChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises OnEnableEffectsChanged event.
Declaration
protected virtual void OnEnableEffectsChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnFirstFrameThicknessChanged(DependencyPropertyChangedEventArgs)
Virtual method to raise the OnFirstFrameThickness event.
Declaration
protected virtual void OnFirstFrameThicknessChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnInitialized(EventArgs)
Raises the System.Windows.FrameworkElement.Initialized event. This method is invoked whenever System.Windows.FrameworkElement.IsInitialized property is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The System.EventArgs that contains the event data. |
OnInnerFrameContentChanged(DependencyPropertyChangedEventArgs)
Updates property value cache.
Declaration
protected virtual void OnInnerFrameContentChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnIsColorMergeWithBaseChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises IsColorMergeWithBaseChangedz event.
Declaration
protected virtual void OnIsColorMergeWithBaseChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnMouseWheel(MouseWheelEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseWheelEventArgs | e | The System.Windows.Input.MouseWheelEventArgs that contains the event data. |
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.
Declaration
protected override void OnRender(DrawingContext drawingContext)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The drawing instructions for a specific element. This context is provided to the layout system. |
OnRenderSizeChanged(SizeChangedInfo)
Raises the System.Windows.FrameworkElement.SizeChanged event, using the specified information as part of the eventual event data.
Declaration
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.SizeChangedInfo | sizeInfo | Details of the old and new size involved in the change. |
OnSecondFrameThicknessChanged(DependencyPropertyChangedEventArgs)
Virtual method to raise the OnSecondFrameThickness event.
Declaration
protected virtual void OnSecondFrameThicknessChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
RefreshAdornerLayer()
Refreshes the Adorner layer
Declaration
protected virtual void RefreshAdornerLayer()
RefreshBorders()
Updates gauge frames.
Declaration
protected virtual void RefreshBorders()
UpdateChildrenLocation()
Updates the location of children elements.
Declaration
protected virtual void UpdateChildrenLocation()
Events
AdornerStyleChanged
Event that is raised when AdornerStyle property is changed.
Declaration
public event PropertyChangedCallback AdornerStyleChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
ApplyFrameStylesChanged
Event that is raised when ApplyFrameStyles property is changed.
Declaration
public event PropertyChangedCallback ApplyFrameStylesChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
EnableEffectsChanged
Event that is raised when EnableEffects property is changed.
Declaration
public event PropertyChangedCallback EnableEffectsChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
FirstFrameThicknessChanged
Event that is raised when FirstFrameThickness property is changed.
Declaration
public event PropertyChangedCallback FirstFrameThicknessChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
IsColorMergeWithBaseChanged
Event that is raised when IsColorMergeWithBase property is changed.
Declaration
public event PropertyChangedCallback IsColorMergeWithBaseChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
SecondFrameThicknessChanged
Event that is raised when SecondFrameThickness property is changed.
Declaration
public event PropertyChangedCallback SecondFrameThicknessChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |