-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathIndicator.cs
90 lines (81 loc) · 2.75 KB
/
Indicator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;
namespace AmCharts.Windows.QuickCharts
{
/// <summary>
/// Represents and indicator of current data point in serial chart.
/// </summary>
public class Indicator : Control
{
/// <summary>
/// Creates Indicator instance.
/// </summary>
public Indicator()
{
this.DefaultStyleKey = typeof(Indicator);
Visibility = Visibility.Collapsed;
}
/// <summary>
/// Positions indicator.
/// </summary>
/// <param name="position">Data point coordinates.</param>
public void SetPosition(Point position)
{
SetValue(Canvas.LeftProperty, position.X);
SetValue(Canvas.TopProperty, position.Y);
}
/// <summary>
/// Identifies <see cref="Fill"/> dependency property.
/// </summary>
public static readonly DependencyProperty FillProperty = DependencyProperty.Register(
"Fill", typeof(Brush), typeof(Indicator),
new PropertyMetadata(null)
);
/// <summary>
/// Gets or sets filling Brush for the indicator.
/// This is a dependency property.
/// </summary>
public Brush Fill
{
get { return (Brush)GetValue(Indicator.FillProperty); }
set { SetValue(Indicator.FillProperty, value); }
}
/// <summary>
/// Identifies <see cref="Stroke"/> dependency property.
/// </summary>
public static readonly DependencyProperty StrokeProperty = DependencyProperty.Register(
"Stroke", typeof(Brush), typeof(Indicator),
new PropertyMetadata(null)
);
/// <summary>
/// Gets or sets stroke (outline) Brush for the indicator.
/// This is a dependency property.
/// </summary>
public Brush Stroke
{
get { return (Brush)GetValue(Indicator.StrokeProperty); }
set { SetValue(Indicator.StrokeProperty, value); }
}
/// <summary>
/// Identifies <see cref="Text"/> dependency property.
/// </summary>
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(Indicator),
new PropertyMetadata(null)
);
/// <summary>
/// Gets or sets balloon text.
/// This is a dependency property.
/// </summary>
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
}
}