Class LinearBarPointer
Represents the linear bar pointer visual element, which starts from the scale's minimum and goes up to the current value to be pointed out by the pointer.
Inherited Members
Namespace: Syncfusion.Windows.Gauge
Assembly: Syncfusion.Gauge.WPF.dll
Syntax
public class LinearBarPointer : LinearPointer
Remarks
The LinearBarPointer is animated using System.Windows.Media.Animation.DoubleAnimation. Both LinearBarPointer and LinearMarkerPointer can be used hand-in-hand or independently, it depends on one's personal preference.
Examples
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;
using Syncfusion.Windows.Shared;
using Syncfusion.Windows.Gauge;
namespace LinearBarPointerSample
{
public partial class Window1 : Window
{
private LinearGauge linearGauge1;
public Window1()
{
InitializeComponent();
linearGauge1 = new LinearGauge();
this.linearGauge1.CenterFrameFillColor = Colors.Brown;
LinearScale scale = new LinearScale();
scale.Minimum = 0;
scale.Maximum = 100;
scale.MinorIntervalValue = 2;
scale.MajorIntervalValue = 10;
scale.ScaleBarSize = 20;
scale.ScaleBarLength = 260;
linearGauge1.Scales.Add(scale);
LinearBarPointer pointer = new LinearBarPointer();
pointer.BackgroundBrush = Brushes.Red;
pointer.BorderBrush = new SolidColorBrush(Colors.Red);
pointer.PointerWidth = 8;
pointer.Value = 45;
scale.Pointers.Add(pointer);
this.Content = linearGauge1;
}
}
}
Constructors
LinearBarPointer()
Initializes a new instance of the LinearBarPointer class.
Declaration
public LinearBarPointer()
Fields
BarCustomGeometryProperty
Identifies the BarCustomGeometry dependency property.
Declaration
public static readonly DependencyProperty BarCustomGeometryProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
BarStyleProperty
Identifies the MarkerStyle dependency property.
Declaration
public static readonly DependencyProperty BarStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
BarCustomGeometry
Gets or sets the custom geometry value for Bar pointer.
Declaration
public Geometry BarCustomGeometry { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Geometry | Type : System.Windows.Media.Geometry Default Value is Null. |
BarStyle
Gets or sets the different shapes for the bar pointer. This is a dependency property.
Declaration
public BarStyle BarStyle { get; set; }
Property Value
Type | Description |
---|---|
BarStyle | Type: BarStyle Default value is BarStyle.Rectangle. |
Methods
ArrangeOverride(Size)
Positions child elements and determines a size for the element.
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | finalSize | The final area within the parent that this element should use to arrange itself and its children. |
Returns
Type | Description |
---|---|
System.Windows.Size | The actual size used. |
MeasureOverride(Size)
Measures the size in layout required for child elements and determines a size for the element.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | availableSize | The available size that this element can give to child elements. |
Returns
Type | Description |
---|---|
System.Windows.Size | The size that this element determines it needs during layout. |
OnBarStyleChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises BarStyleChanged event.
Declaration
protected virtual void OnBarStyleChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnGotFocus(RoutedEventArgs)
Invoked whenever an unhandled System.Windows.UIElement.GotFocus event reaches this element in its route.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs that contains the event data. |
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. |
OnLostFocus(RoutedEventArgs)
Raises the System.Windows.UIElement.LostFocus routed event by using the event data that is provided.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.RoutedEventArgs | e | A System.Windows.RoutedEventArgs that contains event data. This event data must contain the identifier for the System.Windows.UIElement.LostFocus event. |
OnPointerWidthChanged(DependencyPropertyChangedEventArgs)
Raised when PointerWidthProperty is changed.
Declaration
protected override void OnPointerWidthChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
Overrides
OnRender(DrawingContext)
Participates in rendering operations that are directed by the layout system.
Declaration
protected override void OnRender(DrawingContext drawingContext)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The drawing instructions for a specific element. |
Remarks
Draws the rectangular bar pointer
RefreshPointerPosition()
Updates the position of the pointer by transforming it to the correct position. The pointer is created to the appropriate height
and width at the center point of the Gauge and then transformed.
Declaration
protected override void RefreshPointerPosition()
Overrides
Events
BarCustomGeometryChanged
Event that will raise when BarCustomGeometry property is changed.
Declaration
public event PropertyChangedCallback BarCustomGeometryChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
BarStyleChanged
Event that is raised when BarStyle property is changed.
Declaration
public event PropertyChangedCallback BarStyleChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |