From 381292c8a29b30f6a61c94fc5762580d6e3c3f96 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Tue, 5 Apr 2011 19:50:49 +0000 Subject: [PATCH] UpDownBase: found issue in .NET 3.5 version with updating text. --- .../Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs | 7 ++++--- .../Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs b/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs index 3001fa37..b533ae07 100644 --- a/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs +++ b/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs @@ -74,7 +74,7 @@ namespace Microsoft.Windows.Controls.Primitives } protected virtual T OnCoerceValue(T value) - { + { return value; } @@ -92,7 +92,7 @@ namespace Microsoft.Windows.Controls.Primitives RoutedPropertyChangedEventArgs args = new RoutedPropertyChangedEventArgs(oldValue, newValue); args.RoutedEvent = ValueChangedEvent; RaiseEvent(args); - } + } #endregion //Value @@ -259,7 +259,8 @@ namespace Microsoft.Windows.Controls.Primitives #if VS2008 //there is a bug in .NET 3.5 which will not correctly update the textbox text through binding. - TextBox.Text = Text; + if (TextBox != null) + TextBox.Text = Text; #endif _isSyncingTextAndValueProperties = false; diff --git a/Release/v1.4.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs b/Release/v1.4.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs index 3001fa37..a97633bd 100644 --- a/Release/v1.4.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs +++ b/Release/v1.4.0/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs @@ -259,7 +259,8 @@ namespace Microsoft.Windows.Controls.Primitives #if VS2008 //there is a bug in .NET 3.5 which will not correctly update the textbox text through binding. - TextBox.Text = Text; + if (TextBox != null) + TextBox.Text = Text; #endif _isSyncingTextAndValueProperties = false;