From 02684f9ff69592ebb7c8ecc0567166a44b834f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Thu, 27 Feb 2020 08:35:53 -0500 Subject: [PATCH 1/2] Fix RadialGauge default template value formatting This update fixes the `RadialGauge` value text formatting that was overridden by a template binding on the `Value` property. Here's the appropriate text update location: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/ef6527227539362125a0617d9b9821b2c009e11e/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs#L537 --- Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.xaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.xaml b/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.xaml index 5a70512d6f9..d9b428eceb5 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.xaml +++ b/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.xaml @@ -108,7 +108,6 @@ FontSize="20" FontWeight="SemiBold" Foreground="{TemplateBinding Foreground}" - Text="{TemplateBinding Value}" TextAlignment="Center" /> Date: Tue, 10 Mar 2020 21:07:23 -0400 Subject: [PATCH 2/2] Adjust Value update on change, update sample. --- .../SamplePages/RadialGauge/RadialGaugeCode.bind | 1 + Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RadialGauge/RadialGaugeCode.bind b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RadialGauge/RadialGaugeCode.bind index cfd2706e3d1..9a332b448d4 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RadialGauge/RadialGaugeCode.bind +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RadialGauge/RadialGaugeCode.bind @@ -26,6 +26,7 @@ MinAngle="@[MinAngle:Slider:210:0-360]" MaxAngle="@[MaxAngle:Slider:150:0-360]" Unit="units" + ValueStringFormat="@[ValueStringFormat:String:N0]" NeedleWidth="@[NeedleWidth:Slider:4:1-10]" NeedleLength="@[NeedleLength:Slider:100:20-100]" TickLength="@[TickLength:Slider:10:0-30]" diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs b/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs index f105bed8a10..256a6268757 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/RadialGauge/RadialGauge.cs @@ -88,7 +88,7 @@ public class RadialGauge : RangeBase /// Identifies the ValueStringFormat dependency property. /// public static readonly DependencyProperty ValueStringFormatProperty = - DependencyProperty.Register(nameof(ValueStringFormat), typeof(string), typeof(RadialGauge), new PropertyMetadata("N0")); + DependencyProperty.Register(nameof(ValueStringFormat), typeof(string), typeof(RadialGauge), new PropertyMetadata("N0", (s, e) => OnValueChanged(s))); /// /// Identifies the TickSpacing dependency property.