Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions source/NumericUpDownLib/Base/AbstractBaseUpDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,25 @@ public byte DisplayLength
{
get { return (byte)GetValue(DisplayLengthProperty); }
set { SetValue(DisplayLengthProperty, value); }
}

/// <summary>
/// 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.
/// </summary>
public bool IsDisplayLengthFixed
}

/// <summary>
/// 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.
/// </summary>
public virtual double MinWidth
{
get { return (double)GetValue(MinWidthProperty); }
set { SetValue(MinWidthProperty, value); }
}

/// <summary>
/// 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.
/// </summary>
public bool IsDisplayLengthFixed
{
get { return (bool)GetValue(IsDisplayLengthFixedProperty); }
set { SetValue(IsDisplayLengthFixedProperty, value); }
Expand Down
4 changes: 2 additions & 2 deletions source/NumericUpDownLib/Base/InputBaseUpDown.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:InputBaseUpDown}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid VerticalAlignment="Top">
<Grid VerticalAlignment="Top" MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=MinWidth}">
<Grid.Resources>
<conv:ByteToPlaceHolderStringConverter x:Key="ByteToPlaceHolderStringConverter" />
<conv:BoolToVisibilityPropConverter x:Key="BoolToVisibilityConverter" />
Expand All @@ -22,7 +22,7 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

Expand Down