Class CircularCustomLabel
Represents a customizable label child element of the circular Gauge control.
Inherited Members
Namespace: Syncfusion.Windows.Gauge
Assembly: Syncfusion.Gauge.WPF.dll
Syntax
public class CircularCustomLabel : LocalizableGaugeElement
Remarks
The Label can be placed anywhere within the Gauge using Location property.
Examples
using System;
using System.Windows;
using System.Windows.Controls;
using Syncfusion.Windows.Shared;
using Syncfusion.Windows.Gauge;
namespace CustomLabelSample
{
public partial class Window1 : Window
{
private CircularGauge m_gauge;
private CircularCustomLabel m_customLabel1;
private CircularCustomLabel m_customLabel2;
public Window1()
{
InitializeComponent();
m_gauge = new CircularGauge();
m_customLabel1 = new CircularCustomLabel();
m_customLabel2 = new CircularCustomLabel();
m_customLabel1.LabelValue = "Speedometer";
m_customLabel2.LabelValue = "MPH";
m_customLabel1.BackgroundBrush = Brushes.White;
m_customLabel2.BackgroundBrush = Brushes.White;
m_customLabel1.Location = new Point(50, 20);
m_customLabel2.Location = new Point(50, 80);
m_gauge.CustomLabels.Add(m_customLabel1);
m_gauge.CustomLabels.Add(m_customLabel2);
this.Content = m_gauge;
}
}
}
Constructors
CircularCustomLabel()
Declaration
public CircularCustomLabel()
Fields
FontFamilyProperty
Identifies the FontFamily dependency property.
Declaration
public static readonly DependencyProperty FontFamilyProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FontSizeProperty
Identifies the FontSize dependency property.
Declaration
public static readonly DependencyProperty FontSizeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FontWeightProperty
Identifies the FontWeight dependency property.
Declaration
public static readonly DependencyProperty FontWeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LabelValueProperty
Identifies the LabelValue dependency property, which stores the value of the Label.
Declaration
public static readonly DependencyProperty LabelValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
TextAngleProperty
Identifies the TextAngle dependency property.
Declaration
public static readonly DependencyProperty TextAngleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
FontFamily
Gets or sets the font family for the label. This is a dependency property.
Declaration
public FontFamily FontFamily { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.FontFamily | Type: FontFamily |
FontSize
Gets or sets the font size for the label. This is a dependency property.
Declaration
public double FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Type: System.Double Default value is 10. |
FontWeight
Gets or sets the font weight for the label. This is a dependency property.
Declaration
public FontWeight FontWeight { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.FontWeight | Type: FontWeight |
LabelValue
Gets or sets the text of the label. This is a dependency property.
Declaration
public string LabelValue { get; set; }
Property Value
Type | Description |
---|---|
System.String | Type: System.String Default value is String.Empty. |
TextAngle
Gets or sets the rotation angle applied to the label. This is a dependency property.
Declaration
public double TextAngle { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Type: System.Double Default value is 0. |
Methods
MeasureOverride(Size)
Measures the size in layout required for child elements and determines a size for the element.
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | constraint | 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. |
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. |
OnLabelValueChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises LabelValueChanged event.
Declaration
protected virtual void OnLabelValueChanged(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. |
OnTextAngleChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises TextAngleChanged event.
Declaration
protected virtual void OnTextAngleChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
Events
LabelValueChanged
Event that is raised when LabelValue property is changed.
Declaration
public event PropertyChangedCallback LabelValueChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
TextAngleChanged
Event that is raised when TextAngle property is changed.
Declaration
public event PropertyChangedCallback TextAngleChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |