Class LinearMarkerPointer
Represents the pointer visual element which may assist the Bar pointer in denoting values.
Inherited Members
Namespace: Syncfusion.Windows.Gauge
Assembly: Syncfusion.Gauge.WPF.dll
Syntax
public class LinearMarkerPointer : LinearPointer
Remarks
The LinearMarkerPointer and LinearBarPointer can be used hand-in-hand or independently to denote values on the Scale, 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 System.Windows.Data;
using Syncfusion.Windows.Shared;
using Syncfusion.Windows.Gauge;
namespace LinearMarkerPointerSample
{
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);
LinearMarkerPointer markpointer = new LinearMarkerPointer();
markpointer.BackgroundBrush = Brushes.Black;
markpointer.PointerLength = 10;
markpointer.PointerWidth = 10;
markpointer.MarkerStyle = MarkerStyle.Triangle;
markpointer.PointerPlacement = ScalePlacement.Outside;
Binding bind = new Binding("Value");
bind.Source = pointer;
markpointer.SetBinding(LinearMarkerPointer.ValueProperty, bind);
scale.Pointers.Add(markpointer);
this.Content = linearGauge1;
}
}
}
Constructors
LinearMarkerPointer()
Initializes a new instance of the LinearMarkerPointer class.
Declaration
public LinearMarkerPointer()
Fields
MarkerCustomGeometryProperty
Identifies the MarkerCustomGeometry dependency property.
Declaration
public static readonly DependencyProperty MarkerCustomGeometryProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MarkerStyleProperty
Identifies the MarkerStyle dependency property.
Declaration
public static readonly DependencyProperty MarkerStyleProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PointerLengthProperty
Identifies the PointerLength dependency property.
Declaration
public static readonly DependencyProperty PointerLengthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PointerPlacementProperty
Identifies the PointerPlacement dependency property.
Declaration
public static readonly DependencyProperty PointerPlacementProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
MarkerCustomGeometry
Gets or sets the custom geometry value for Marker.
Declaration
public Geometry MarkerCustomGeometry { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Geometry | Type : System.Windows.Media.Geometry Default Value is Null. |
MarkerStyle
Gets or sets the different shapes for the marker pointer. This is a dependency property.
Declaration
public MarkerStyle MarkerStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| MarkerStyle | Type: MarkerStyle Default value is MarkerStyle.Rectangle. |
PointerLength
Gets or sets the length of the pointer. This is a dependency property.
Declaration
public double PointerLength { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | Type: System.Double Default value is 0. |
See Also
PointerPlacement
Gets or sets the placement of the marker pointer relative to the scale. This is a dependency property.
Declaration
public ScalePlacement PointerPlacement { get; set; }
Property Value
| Type | Description |
|---|---|
| ScalePlacement | Type: ScalePlacement Default value is ScalePlacement.Inside. |
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. |
CoercePointerLength(Object)
Fulfils the logic before setting the value of PointerLength dependency property.
Declaration
protected virtual object CoercePointerLength(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The value that should be corrected. |
Returns
| Type | Description |
|---|---|
| System.Object | The corrected value. |
CoercePointerLength(DependencyObject, Object)
Coerces the value of the PointerLength property.
Declaration
public static object CoercePointerLength(DependencyObject d, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | d | The LinearMarkerPointer object. |
| System.Object | value | The instance containing the event data. |
Returns
| Type | Description |
|---|---|
| System.Object | The checked value. |
GetValueByPosition(Double)
Gets the corresponding value for Pointer position passed.
Declaration
public double GetValueByPosition(double pos)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | pos | Pointer position. |
Returns
| Type | Description |
|---|---|
| System.Double | Value. |
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. |
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. |
OnMarkerStyleChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises MarkerStyleChanged event.
Declaration
protected virtual void OnMarkerStyleChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnPointerLengthChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises PointerLengthChanged event.
Declaration
protected virtual void OnPointerLengthChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnPointerPlacementChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises PointerPlacementChanged event.
Declaration
protected virtual void OnPointerPlacementChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
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
For Triangle-Inside placement, for Pentagon and for Trapezoid, we have to Rotate the geometry by 180 degree
RefreshPointerPosition()
Updates the position of the pointer.
Declaration
protected override void RefreshPointerPosition()
Overrides
Remarks
The pointer which is drawn in the Center by OnRender method is transformed to the appropriate location
Events
MarkerCustomGeometryChanged
Event that will raise when MarkerCustomGeometry property is changed.
Declaration
public event PropertyChangedCallback MarkerCustomGeometryChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
MarkerStyleChanged
Event that is raised when MarkerStyle property is changed.
Declaration
public event PropertyChangedCallback MarkerStyleChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
PointerLengthChanged
Event that is raised when PointerLength property is changed.
Declaration
public event PropertyChangedCallback PointerLengthChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |
PointerPlacementChanged
Event that is raised when PointerPlacement property is changed.
Declaration
public event PropertyChangedCallback PointerPlacementChanged
Event Type
| Type |
|---|
| System.Windows.PropertyChangedCallback |