Skip to content

Commit afed92f

Browse files
Merge pull request #3153 from jeromelaban/patch-1
Fix RadialGauge default template value formatting
2 parents d85e1a7 + 6221a69 commit afed92f

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RadialGauge/RadialGaugeCode.bind

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
MinAngle="@[MinAngle:Slider:210:0-360]"
2727
MaxAngle="@[MaxAngle:Slider:150:0-360]"
2828
Unit="units"
29+
ValueStringFormat="@[ValueStringFormat:String:N0]"
2930
NeedleWidth="@[NeedleWidth:Slider:4:1-10]"
3031
NeedleLength="@[NeedleLength:Slider:100:20-100]"
3132
TickLength="@[TickLength:Slider:10:0-30]"

Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class RadialGauge : RangeBase
8888
/// Identifies the ValueStringFormat dependency property.
8989
/// </summary>
9090
public static readonly DependencyProperty ValueStringFormatProperty =
91-
DependencyProperty.Register(nameof(ValueStringFormat), typeof(string), typeof(RadialGauge), new PropertyMetadata("N0"));
91+
DependencyProperty.Register(nameof(ValueStringFormat), typeof(string), typeof(RadialGauge), new PropertyMetadata("N0", (s, e) => OnValueChanged(s)));
9292

9393
/// <summary>
9494
/// Identifies the TickSpacing dependency property.

Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
FontSize="20"
109109
FontWeight="SemiBold"
110110
Foreground="{TemplateBinding Foreground}"
111-
Text="{TemplateBinding Value}"
112111
TextAlignment="Center" />
113112
<TextBlock Margin="0"
114113
FontSize="16"

0 commit comments

Comments
 (0)