From 3e7f54767c8482f0eee0c5458e2fbab206d2497d Mon Sep 17 00:00:00 2001 From: Ryan Weldin Date: Mon, 5 Sep 2022 13:26:57 -0500 Subject: [PATCH] Add AbstractBaseUpDown MinWidth virtual property MinWidth property fills the width of the control with the textbox portion of the control --- .../Base/AbstractBaseUpDown.cs | 27 +++++++++++++------ .../Base/InputBaseUpDown.xaml | 4 +-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs b/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs index d79d65e..82a3528 100644 --- a/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs +++ b/source/NumericUpDownLib/Base/AbstractBaseUpDown.cs @@ -320,14 +320,25 @@ public byte DisplayLength { get { return (byte)GetValue(DisplayLengthProperty); } set { SetValue(DisplayLengthProperty, value); } - } - - /// - /// Gets/sets whether the textbox portion of the numeric up down control - /// can go grow and shrink with its input or whether it should stay with - /// a fixed width. - /// - public bool IsDisplayLengthFixed + } + + /// + /// Gets/sets the MinWidth for the control. The width of the textbox portion of + /// the control is expanded to fill the MinWidth value while the width of the + /// UpDown buttons are auto sized. + /// + public virtual double MinWidth + { + get { return (double)GetValue(MinWidthProperty); } + set { SetValue(MinWidthProperty, value); } + } + + /// + /// Gets/sets whether the textbox portion of the numeric up down control + /// can go grow and shrink with its input or whether it should stay with + /// a fixed width. + /// + public bool IsDisplayLengthFixed { get { return (bool)GetValue(IsDisplayLengthFixedProperty); } set { SetValue(IsDisplayLengthFixedProperty, value); } diff --git a/source/NumericUpDownLib/Base/InputBaseUpDown.xaml b/source/NumericUpDownLib/Base/InputBaseUpDown.xaml index aa1cecc..7af4057 100644 --- a/source/NumericUpDownLib/Base/InputBaseUpDown.xaml +++ b/source/NumericUpDownLib/Base/InputBaseUpDown.xaml @@ -12,7 +12,7 @@ - + @@ -22,7 +22,7 @@ - +