File tree Expand file tree Collapse file tree 2 files changed +21
-10
lines changed
source/NumericUpDownLib/Base Expand file tree Collapse file tree 2 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -435,14 +435,25 @@ public byte DisplayLength
435
435
{
436
436
get { return ( byte ) GetValue ( DisplayLengthProperty ) ; }
437
437
set { SetValue ( DisplayLengthProperty , value ) ; }
438
- }
439
-
440
- /// <summary>
441
- /// Gets/sets whether the textbox portion of the numeric up down control
442
- /// can go grow and shrink with its input or whether it should stay with
443
- /// a fixed width.
444
- /// </summary>
445
- public bool IsDisplayLengthFixed
438
+ }
439
+
440
+ /// <summary>
441
+ /// Gets/sets the MinWidth for the control. The width of the textbox portion of
442
+ /// the control is expanded to fill the MinWidth value while the width of the
443
+ /// UpDown buttons are auto sized.
444
+ /// </summary>
445
+ public virtual double MinWidth
446
+ {
447
+ get { return ( double ) GetValue ( MinWidthProperty ) ; }
448
+ set { SetValue ( MinWidthProperty , value ) ; }
449
+ }
450
+
451
+ /// <summary>
452
+ /// Gets/sets whether the textbox portion of the numeric up down control
453
+ /// can go grow and shrink with its input or whether it should stay with
454
+ /// a fixed width.
455
+ /// </summary>
456
+ public bool IsDisplayLengthFixed
446
457
{
447
458
get { return ( bool ) GetValue ( IsDisplayLengthFixedProperty ) ; }
448
459
set { SetValue ( IsDisplayLengthFixedProperty , value ) ; }
Original file line number Diff line number Diff line change 12
12
<Setter .Value>
13
13
<ControlTemplate TargetType =" {x:Type local:InputBaseUpDown}" >
14
14
<Border BorderBrush =" {TemplateBinding BorderBrush}" BorderThickness =" {TemplateBinding BorderThickness}" >
15
- <Grid VerticalAlignment =" Top" >
15
+ <Grid VerticalAlignment =" Top" MinWidth = " {Binding RelativeSource={RelativeSource TemplatedParent}, Path=MinWidth} " >
16
16
<Grid .Resources>
17
17
<conv : ByteToPlaceHolderStringConverter x : Key =" ByteToPlaceHolderStringConverter" />
18
18
<conv : BoolToVisibilityPropConverter x : Key =" BoolToVisibilityConverter" />
22
22
<RowDefinition Height =" Auto" />
23
23
</Grid .RowDefinitions>
24
24
<Grid .ColumnDefinitions>
25
- <ColumnDefinition Width =" Auto " />
25
+ <ColumnDefinition Width =" * " />
26
26
<ColumnDefinition Width =" Auto" />
27
27
</Grid .ColumnDefinitions>
28
28
You can’t perform that action at this time.
0 commit comments