3
3
// See the LICENSE file in the project root for more information.
4
4
5
5
using System . Collections . Generic ;
6
+ using Windows . Foundation ;
7
+ using Windows . UI . Xaml . Automation ;
6
8
using Windows . UI . Xaml . Automation . Peers ;
7
9
using Windows . UI . Xaml . Automation . Provider ;
8
10
@@ -12,7 +14,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
12
14
/// Exposes <see cref="RadialGauge"/> to Microsoft UI Automation.
13
15
/// </summary>
14
16
public class RadialGaugeAutomationPeer :
15
- FrameworkElementAutomationPeer ,
17
+ RangeBaseAutomationPeer ,
16
18
IRangeValueProvider
17
19
{
18
20
/// <summary>
@@ -25,25 +27,25 @@ public RadialGaugeAutomationPeer(RadialGauge owner)
25
27
}
26
28
27
29
/// <inheritdoc/>
28
- public bool IsReadOnly => ! ( ( RadialGauge ) Owner ) . IsInteractive ;
30
+ public new bool IsReadOnly => ! ( ( RadialGauge ) Owner ) . IsInteractive ;
29
31
30
32
/// <inheritdoc/>
31
- public double LargeChange => ( ( RadialGauge ) Owner ) . StepSize ;
33
+ public new double LargeChange => ( ( RadialGauge ) Owner ) . StepSize ;
32
34
33
35
/// <inheritdoc/>
34
- public double Maximum => ( ( RadialGauge ) Owner ) . Maximum ;
36
+ public new double Maximum => ( ( RadialGauge ) Owner ) . Maximum ;
35
37
36
38
/// <inheritdoc/>
37
- public double Minimum => ( ( RadialGauge ) Owner ) . Minimum ;
39
+ public new double Minimum => ( ( RadialGauge ) Owner ) . Minimum ;
38
40
39
41
/// <inheritdoc/>
40
- public double SmallChange => ( ( RadialGauge ) Owner ) . StepSize ;
42
+ public new double SmallChange => ( ( RadialGauge ) Owner ) . StepSize ;
41
43
42
44
/// <inheritdoc/>
43
- public double Value => ( ( RadialGauge ) Owner ) . Value ;
45
+ public new double Value => ( ( RadialGauge ) Owner ) . Value ;
44
46
45
47
/// <inheritdoc/>
46
- public void SetValue ( double value )
48
+ public new void SetValue ( double value )
47
49
{
48
50
( ( RadialGauge ) Owner ) . Value = value ;
49
51
}
@@ -58,7 +60,7 @@ protected override IList<AutomationPeer> GetChildrenCore()
58
60
protected override string GetNameCore ( )
59
61
{
60
62
var gauge = ( RadialGauge ) Owner ;
61
- return "radial gauge. " + ( string . IsNullOrWhiteSpace ( gauge . Unit ) ? "no unit specified. " : "unit " + gauge . Unit + ". " ) ;
63
+ return "radial gauge. " + ( string . IsNullOrWhiteSpace ( gauge . Unit ) ? "no unit specified, " : "unit " + gauge . Unit + ", " ) + Value ;
62
64
}
63
65
64
66
/// <inheritdoc/>
@@ -78,5 +80,15 @@ protected override AutomationControlType GetAutomationControlTypeCore()
78
80
{
79
81
return AutomationControlType . Custom ;
80
82
}
83
+
84
+ /// <summary>
85
+ /// Raises the property changed event for this AutomationPeer for the provided identifier.
86
+ /// </summary>
87
+ /// <param name="oldValue">Old value</param>
88
+ /// <param name="newValue">New value</param>
89
+ public void RaiseValueChangedEvent ( double oldValue , double newValue )
90
+ {
91
+ RaisePropertyChangedEvent ( RangeValuePatternIdentifiers . ValueProperty , PropertyValue . CreateDouble ( oldValue ) , PropertyValue . CreateDouble ( newValue ) ) ;
92
+ }
81
93
}
82
94
}
0 commit comments