Class LinearRange
Represents the range visual element, which spans a range of consecutive values represented by a visual.
Inherited Members
Namespace: Syncfusion.Windows.Gauge
Assembly: Syncfusion.Gauge.WPF.dll
Syntax
public class LinearRange : RangeBase
Remarks
The Range's EndValue should be specified before StartValue because of the constraint that the StartValue should not be greater than EndValue
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 LinearRangeSample
{
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);
LinearRange range = new LinearRange();
range.StartValue = 70;
range.EndValue = 100;
range.StartWidth = 0;
range.EndWidth = 10;
range.RangePosition = ScalePlacement.Inside;
range.DistanceFromScale = 2;
range.BackgroundBrush = new SolidColorBrush(Colors.OrangeRed);
scale.Ranges.Add(range);
this.Content = linearGauge1;
}
}
}
Constructors
LinearRange()
Initializes a new instance of the LinearRange class.
Declaration
public LinearRange()
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. |
OnBindIndicatorChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises StartValueChanged /> event.
Declaration
protected override void OnBindIndicatorChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
Overrides
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. |
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. |