-
Notifications
You must be signed in to change notification settings - Fork 0
/
SegmentedCircularProgressBar.xaml.cs
123 lines (83 loc) · 4.15 KB
/
SegmentedCircularProgressBar.xaml.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace CircularProgressBar.Controls
{
public partial class SegmentedCircularProgressBar : UserControl
{
public SegmentedCircularProgressBar()
{
InitializeComponent();
}
public double MinValue
{
get { return (double)GetValue(MinValueProperty); }
set { SetValue(MinValueProperty, value); }
}
public static readonly DependencyProperty MinValueProperty =
DependencyProperty.Register("MinValue", typeof(double), typeof(SegmentedCircularProgressBar), new PropertyMetadata(0d));
public double MaxValue
{
get { return (double)GetValue(MaxValueProperty); }
set { SetValue(MaxValueProperty, value); }
}
public static readonly DependencyProperty MaxValueProperty =
DependencyProperty.Register("MaxValue", typeof(double), typeof(SegmentedCircularProgressBar), new PropertyMetadata(100d));
public double Value
{
get { return (double)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(double), typeof(SegmentedCircularProgressBar), new PropertyMetadata(0d));
public int Thickness
{
get { return (int)GetValue(ThicknessProperty); }
set { SetValue(ThicknessProperty, value); }
}
public static readonly DependencyProperty ThicknessProperty =
DependencyProperty.Register("Thickness", typeof(int), typeof(SegmentedCircularProgressBar), new PropertyMetadata(15));
public int ProgressThickness
{
get { return (int)GetValue(ProgressThicknessProperty); }
set { SetValue(ProgressThicknessProperty, value); }
}
public static readonly DependencyProperty ProgressThicknessProperty =
DependencyProperty.Register("ProgressThickness", typeof(int), typeof(SegmentedCircularProgressBar), new PropertyMetadata(15));
public Brush TextBrush
{
get { return (Brush)GetValue(TextBrushProperty); }
set { SetValue(TextBrushProperty, value); }
}
public static readonly DependencyProperty TextBrushProperty =
DependencyProperty.Register("TextBrush", typeof(Brush), typeof(SegmentedCircularProgressBar), new PropertyMetadata(Brushes.DeepSkyBlue));
public Brush Segment1Brush
{
get { return (Brush)GetValue(Segment1BrushProperty); }
set { SetValue(Segment1BrushProperty, value); }
}
public static readonly DependencyProperty Segment1BrushProperty =
DependencyProperty.Register("Segment1Brush", typeof(Brush), typeof(SegmentedCircularProgressBar), new PropertyMetadata(Brushes.Coral));
public Brush Segment2Brush
{
get { return (Brush)GetValue(Segment2BrushProperty); }
set { SetValue(Segment2BrushProperty, value); }
}
public static readonly DependencyProperty Segment2BrushProperty =
DependencyProperty.Register("Segment2Brush", typeof(Brush), typeof(SegmentedCircularProgressBar), new PropertyMetadata(Brushes.LightCoral));
public Brush Segment3Brush
{
get { return (Brush)GetValue(Segment3BrushProperty); }
set { SetValue(Segment3BrushProperty, value); }
}
public static readonly DependencyProperty Segment3BrushProperty =
DependencyProperty.Register("Segment3Brush", typeof(Brush), typeof(SegmentedCircularProgressBar), new PropertyMetadata(Brushes.Gold));
public Brush Segment4Brush
{
get { return (Brush)GetValue(Segment4BrushProperty); }
set { SetValue(Segment4BrushProperty, value); }
}
public static readonly DependencyProperty Segment4BrushProperty =
DependencyProperty.Register("Segment4Brush", typeof(Brush), typeof(SegmentedCircularProgressBar), new PropertyMetadata(Brushes.LightGreen));
}
}