Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ decimal largeStepSize
base.MaximumValue = maximumValue;
base.StepSize = stepSize;
base.LargeStepSize = largeStepSize;

// "decimal" does not support format string "D" as set in base class
FormatString = "F4";
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions source/Demo/UpDownDemoLib/ViewModels/DoubleUpDownViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ double largestepSize
base.MaximumValue = maximumValue;
base.StepSize = stepSize;
base.LargeStepSize = largestepSize;

FormatString = "F4";
}

/// Method determine whether two objects of type {T} are equal.
Expand Down
2 changes: 2 additions & 0 deletions source/Demo/UpDownDemoLib/ViewModels/FloatUpDownViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ float largeStepSize
base.MaximumValue = maximumValue;
base.StepSize = stepSize;
base.LargeStepSize = largeStepSize;

FormatString = "F4";
}

/// Method determine whether two objects of type {T} are equal.
Expand Down
28 changes: 20 additions & 8 deletions source/Demo/UpDownDemoLib/Views/ByteUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
Expand All @@ -25,9 +26,8 @@
<cntrl:ByteUpDown
Name="SampleUpDown"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="3"
HorizontalAlignment="Left"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
Expand All @@ -43,10 +43,9 @@
ToolTip="{Binding ToolTip, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<Grid
Grid.Row="1"
Grid.Column="1"
Margin="12,3,3,3">
<GridSplitter Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="5" HorizontalAlignment="Stretch" />

<Grid Grid.Row="0" Grid.Column="2" Margin="12,3,3,3">
<Grid.Resources>
<conv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Grid.Resources>
Expand Down Expand Up @@ -259,7 +258,20 @@
IsChecked="{Binding Path=AccelModifierKey, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Shift}" />
</StackPanel>
</Border>
</StackPanel>

<Border
Margin="0,3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Margin="3">

<Label Content="FormatString" />
<TextBox Text="{Binding FormatString}" />

</StackPanel>

</Border>
</StackPanel>
</GroupBox>
</Grid>
</Grid>
Expand Down
29 changes: 21 additions & 8 deletions source/Demo/UpDownDemoLib/Views/DecimalUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
Expand All @@ -25,12 +26,12 @@
<cntrl:DecimalUpDown
Name="SampleUpDown"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="3"
HorizontalAlignment="Left"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="10"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
IsMouseDragEnabled="{Binding ElementName=IsMouseDragEnabledCheckBox, Path=IsChecked}"
IsReadOnly="False"
Expand All @@ -42,10 +43,9 @@
ToolTip="{Binding ToolTip, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<Grid
Grid.Row="1"
Grid.Column="1"
Margin="12,3,3,3">
<GridSplitter Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="5" HorizontalAlignment="Stretch" />

<Grid Grid.Row="0" Grid.Column="2" Margin="12,3,3,3">
<Grid.Resources>
<conv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Grid.Resources>
Expand Down Expand Up @@ -250,7 +250,20 @@
IsChecked="{Binding Path=AccelModifierKey, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Shift}" />
</StackPanel>
</Border>
</StackPanel>

<Border
Margin="0,3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Margin="3">

<Label Content="FormatString" />
<TextBox Text="{Binding FormatString}" />

</StackPanel>

</Border>
</StackPanel>
</GroupBox>
</Grid>
</Grid>
Expand Down
29 changes: 20 additions & 9 deletions source/Demo/UpDownDemoLib/Views/DoubleUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
Expand All @@ -25,13 +26,12 @@
<cntrl:DoubleUpDown
Name="SampleUpDown"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="3"
HorizontalAlignment="Left"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="7"
FormatString="F4"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
IsMouseDragEnabled="{Binding ElementName=IsMouseDragEnabledCheckBox, Path=IsChecked}"
IsReadOnly="False"
Expand All @@ -43,10 +43,9 @@
ToolTip="{Binding ToolTip, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<Grid
Grid.Row="1"
Grid.Column="1"
Margin="12,3,3,3">
<GridSplitter Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="5" HorizontalAlignment="Stretch" />

<Grid Grid.Row="0" Grid.Column="2" Margin="12,3,3,3">
<Grid.Resources>
<conv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Grid.Resources>
Expand Down Expand Up @@ -248,7 +247,19 @@
IsChecked="{Binding Path=AccelModifierKey, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Shift}" />
</StackPanel>
</Border>
</StackPanel>
<Border
Margin="0,3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Margin="3">

<Label Content="FormatString" />
<TextBox Text="{Binding FormatString}" />

</StackPanel>

</Border>
</StackPanel>
</GroupBox>
</Grid>
</Grid>
Expand Down
28 changes: 20 additions & 8 deletions source/Demo/UpDownDemoLib/Views/FloatUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
Expand All @@ -25,12 +26,12 @@
<cntrl:FloatUpDown
Name="SampleUpDown"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="3"
HorizontalAlignment="Left"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
IsMouseDragEnabled="{Binding ElementName=IsMouseDragEnabledCheckBox, Path=IsChecked}"
IsReadOnly="False"
Expand All @@ -42,10 +43,9 @@
ToolTip="{Binding ToolTip, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<Grid
Grid.Row="1"
Grid.Column="1"
Margin="12,3,3,3">
<GridSplitter Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="5" HorizontalAlignment="Stretch" />

<Grid Grid.Row="0" Grid.Column="2" Margin="12,3,3,3">
<Grid.Resources>
<conv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Grid.Resources>
Expand Down Expand Up @@ -250,7 +250,19 @@
IsChecked="{Binding Path=AccelModifierKey, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Shift}" />
</StackPanel>
</Border>
</StackPanel>
<Border
Margin="0,3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Margin="3">

<Label Content="FormatString" />
<TextBox Text="{Binding FormatString}" />

</StackPanel>

</Border>
</StackPanel>
</GroupBox>
</Grid>
</Grid>
Expand Down
51 changes: 31 additions & 20 deletions source/Demo/UpDownDemoLib/Views/LongUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
Expand All @@ -25,10 +26,9 @@
<cntrl:LongUpDown
Name="SampleUpDown"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Expand All @@ -44,10 +44,9 @@
ToolTip="{Binding ToolTip, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<Grid
Grid.Row="1"
Grid.Column="1"
Margin="12,3,3,3">
<GridSplitter Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Width="5" HorizontalAlignment="Stretch" />

<Grid Grid.Row="0" Grid.Column="2" Margin="12,3,3,3">
<Grid.Resources>
<conv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Grid.Resources>
Expand Down Expand Up @@ -230,35 +229,47 @@
ToolTip="Toggles whether a validation indicator is shown in the upper left corner of the control." />
</StackPanel>

<Border
<Border
Margin="0,3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel xmlns:input="System.Windows.Input" Margin="3">
<StackPanel.Resources>
<conv:EnumMatchToBooleanConverter x:Key="enumConverter" />
</StackPanel.Resources>
<StackPanel xmlns:input="System.Windows.Input" Margin="3">
<StackPanel.Resources>
<conv:EnumMatchToBooleanConverter x:Key="enumConverter" />
</StackPanel.Resources>


<TextBlock Margin="3" Text="Press this key to accelerate increments/decrements when scrolling with mouse wheel." />
<TextBlock Margin="3" Text="Press this key to accelerate increments/decrements when scrolling with mouse wheel." />

<RadioButton
<RadioButton
Margin="3"
Content="Alt"
IsChecked="{Binding Path=AccelModifierKey, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Alt}" />

<RadioButton
<RadioButton
Margin="3"
Content="Control"
IsChecked="{Binding Path=AccelModifierKey, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Control}" />

<RadioButton
<RadioButton
Margin="3"
Content="Shift"
IsChecked="{Binding Path=AccelModifierKey, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Shift}" />
</StackPanel>
</Border>
</StackPanel>
</StackPanel>
</Border>
<Border
Margin="0,3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Margin="3">

<Label Content="FormatString" />
<TextBox Text="{Binding FormatString}" />

</StackPanel>

</Border>
</StackPanel>
</GroupBox>
</Grid>
</Grid>
Expand Down
Loading