From 28b2201a2a3d0b01cf02e3b98379761fa349d43c Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Fri, 1 Apr 2011 21:09:11 +0000 Subject: [PATCH] CalculatorUpDown: added DisplayText, Memory, and Precision properties. --- .../Implementation/CalculatorUpDown.cs | 33 +++++++++++++++++++ .../CalculatorUpDown/Themes/Generic.xaml | 6 +++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Implementation/CalculatorUpDown.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Implementation/CalculatorUpDown.cs index 2e6dd5fe..237f990f 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Implementation/CalculatorUpDown.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Implementation/CalculatorUpDown.cs @@ -16,6 +16,17 @@ namespace Microsoft.Windows.Controls #region Properties + #region DisplayText + + public static readonly DependencyProperty DisplayTextProperty = DependencyProperty.Register("DisplayText", typeof(string), typeof(CalculatorUpDown), new UIPropertyMetadata("0")); + public string DisplayText + { + get { return (string)GetValue(DisplayTextProperty); } + set { SetValue(DisplayTextProperty, value); } + } + + #endregion //DisplayText + #region EnterClosesCalculator public static readonly DependencyProperty EnterClosesCalculatorProperty = DependencyProperty.Register("EnterClosesCalculator", typeof(bool), typeof(CalculatorUpDown), new UIPropertyMetadata(false)); @@ -50,6 +61,28 @@ namespace Microsoft.Windows.Controls #endregion //IsOpen + #region Memory + + public static readonly DependencyProperty MemoryProperty = DependencyProperty.Register("Memory", typeof(decimal), typeof(CalculatorUpDown), new UIPropertyMetadata(default(decimal))); + public decimal Memory + { + get { return (decimal)GetValue(MemoryProperty); } + set { SetValue(MemoryProperty, value); } + } + + #endregion //Memory + + #region Precision + + public static readonly DependencyProperty PrecisionProperty = DependencyProperty.Register("Precision", typeof(int), typeof(CalculatorUpDown), new UIPropertyMetadata(6)); + public int Precision + { + get { return (int)GetValue(PrecisionProperty); } + set { SetValue(PrecisionProperty, value); } + } + + #endregion //Precision + #endregion //Properties #region Constructors diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Themes/Generic.xaml b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Themes/Generic.xaml index 95bf8f6d..eb1edc87 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Themes/Generic.xaml +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/CalculatorUpDown/Themes/Generic.xaml @@ -101,7 +101,11 @@ - +