-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpleCircularProgressBar.xaml
64 lines (62 loc) · 4.46 KB
/
SimpleCircularProgressBar.xaml
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
<UserControl x:Class="CircularProgressBar.Controls.SimpleCircularProgressBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dxga="http://schemas.devexpress.com/winfx/2008/xaml/gauges"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:local="clr-namespace:CircularProgressBar.Controls"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<dxga:CircularGaugeControl >
<dxga:CircularGaugeControl.Scales>
<dxga:ArcScale StartAngle="90" EndAngle="450"
x:Name="arc"
StartValue="{Binding RelativeSource={RelativeSource AncestorType=local:SimpleCircularProgressBar}, Path=MinValue}"
EndValue="{Binding RelativeSource={RelativeSource AncestorType=local:SimpleCircularProgressBar}, Path=MaxValue}"
ShowMajorTickmarks="False"
ShowMinorTickmarks="False"
ShowLabels="false"
LayoutMode="Circle" Margin="15">
<dxga:ArcScale.CustomElements>
<dxga:ScaleCustomElement >
<Viewbox>
<TextBlock Margin="28" FontWeight="Medium"
FontFamily="Segoe UI"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding ElementName=ProgressRangeBar1, Path=Value, StringFormat='{}{0:n0}%'}"
Foreground="{Binding RelativeSource={RelativeSource
AncestorType=local:SimpleCircularProgressBar}, Path=TextBrush}"/>
</Viewbox>
</dxga:ScaleCustomElement>
</dxga:ArcScale.CustomElements>
<dxga:ArcScale.RangeBars>
<dxga:ArcScaleRangeBar AnchorValue="{Binding ElementName=arc, Path=StartValue}"
Value="{Binding ElementName=arc, Path=EndValue}">
<dxga:ArcScaleRangeBar.Options>
<dxga:ArcScaleRangeBarOptions Offset="-20" Thickness="{Binding RelativeSource={RelativeSource
AncestorType=local:SimpleCircularProgressBar}, Path=Thickness}"/>
</dxga:ArcScaleRangeBar.Options>
<dxga:ArcScaleRangeBar.Presentation>
<dxga:DefaultArcScaleRangeBarPresentation Fill="#F5E6DE"/>
</dxga:ArcScaleRangeBar.Presentation>
</dxga:ArcScaleRangeBar>
<dxga:ArcScaleRangeBar AnchorValue="0"
Value="{Binding RelativeSource={RelativeSource
AncestorType=local:SimpleCircularProgressBar}, Path=Value}"
x:Name="ProgressRangeBar1">
<dxga:ArcScaleRangeBar.Options>
<dxga:ArcScaleRangeBarOptions Offset="-20" Thickness="{Binding RelativeSource={RelativeSource
AncestorType=local:SimpleCircularProgressBar}, Path=ProgressThickness}"/>
</dxga:ArcScaleRangeBar.Options>
<dxga:ArcScaleRangeBar.Presentation>
<dxga:DefaultArcScaleRangeBarPresentation Fill="{Binding RelativeSource={RelativeSource
AncestorType=local:SimpleCircularProgressBar}, Path=ProgressBrush}"/>
</dxga:ArcScaleRangeBar.Presentation>
</dxga:ArcScaleRangeBar>
</dxga:ArcScale.RangeBars>
</dxga:ArcScale>
</dxga:CircularGaugeControl.Scales>
</dxga:CircularGaugeControl>
</Grid>
</UserControl>