new demo
This commit is contained in:
@@ -16,90 +16,107 @@
|
|||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
</Style>
|
</Style>
|
||||||
</UserControl.Styles>
|
</UserControl.Styles>
|
||||||
<Grid ColumnDefinitions="*,*,*">
|
|
||||||
<StackPanel Grid.Column="0" HorizontalAlignment="Left">
|
|
||||||
<u:NumericIntUpDown
|
|
||||||
Name="input"
|
|
||||||
Classes="ClearButton"
|
|
||||||
InnerLeftContent="Age"
|
|
||||||
Step="1"
|
|
||||||
Watermark="Input Value"
|
|
||||||
Value="2" />
|
|
||||||
<TextBlock Text="{Binding #input.Value}" />
|
|
||||||
<u:NumericDoubleUpDown
|
|
||||||
Name="inputDouble"
|
|
||||||
EmptyInputValue="1"
|
|
||||||
Step="0.5"
|
|
||||||
Value="3.1" />
|
|
||||||
<TextBlock Text="{Binding #inputDouble.Value}" />
|
|
||||||
<u:NumericByteUpDown
|
|
||||||
Name="inputByte"
|
|
||||||
EmptyInputValue="1"
|
|
||||||
Step="1"
|
|
||||||
Value="3" />
|
|
||||||
<TextBlock Text="{Binding #inputByte.Value}" />
|
|
||||||
<TextBlock Text="Drag" />
|
|
||||||
<u:NumericIntUpDown
|
|
||||||
AllowDrag="True"
|
|
||||||
Step="1"
|
|
||||||
Watermark="Input Value"
|
|
||||||
Value="2" />
|
|
||||||
|
|
||||||
<u:NumericIntUpDown
|
<Grid ColumnDefinitions="*,*">
|
||||||
AllowDrag="True"
|
<Grid
|
||||||
InnerLeftContent="Drag"
|
Grid.Column="0"
|
||||||
Step="1"
|
HorizontalAlignment="Left"
|
||||||
Watermark="Input Value"
|
RowDefinitions="200,*">
|
||||||
Value="2" />
|
<StackPanel>
|
||||||
|
<u:Divider Content="Change Right ->" />
|
||||||
|
<u:NumericUIntUpDown
|
||||||
|
Name="numd"
|
||||||
|
HorizontalContentAlignment="{Binding HorizontalContentAlignment}"
|
||||||
|
AllowDrag="{Binding AllowDrag}"
|
||||||
|
AllowSpin="{Binding AllowSpin}"
|
||||||
|
FontFamily="{Binding FontFamily, Mode=OneWay}"
|
||||||
|
FormatString="{Binding FormatString}"
|
||||||
|
InnerLeftContent="{Binding InnerLeftContent}"
|
||||||
|
IsEnabled="{Binding IsEnable}"
|
||||||
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
|
Maximum="{Binding Maximum}"
|
||||||
|
Minimum="{Binding Minimum}"
|
||||||
|
ParsingNumberStyle="{Binding ParsingNumberStyle}"
|
||||||
|
ShowButtonSpinner="{Binding ShowButtonSpinner}"
|
||||||
|
Step="{Binding Step}"
|
||||||
|
Watermark="{Binding Watermark}"
|
||||||
|
Value="{Binding Value}" />
|
||||||
|
<u:Divider Content="Demo" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<!-- hex demo -->
|
<StackPanel Grid.Row="1">
|
||||||
|
<u:Divider Content="{Binding #input.Value, StringFormat='Int = {0}'}" />
|
||||||
|
<u:NumericIntUpDown
|
||||||
|
Name="input"
|
||||||
|
Classes="ClearButton"
|
||||||
|
InnerLeftContent="Age"
|
||||||
|
Step="1"
|
||||||
|
Watermark="Input Value"
|
||||||
|
Value="2" />
|
||||||
|
<u:Divider Content="{Binding #inputDouble.Value, StringFormat='Double = {0}'}" />
|
||||||
|
<u:NumericDoubleUpDown
|
||||||
|
Name="inputDouble"
|
||||||
|
EmptyInputValue="1"
|
||||||
|
Step="0.5"
|
||||||
|
Value="3.1" />
|
||||||
|
<u:Divider Content="{Binding #inputByte.Value, StringFormat='Byte = {0}'}" />
|
||||||
|
<u:NumericByteUpDown
|
||||||
|
Name="inputByte"
|
||||||
|
EmptyInputValue="1"
|
||||||
|
Step="1"
|
||||||
|
Value="3" />
|
||||||
|
<u:Divider Content="{Binding #Drag_Int.Value, StringFormat='Drag Int = {0}'}" />
|
||||||
|
<u:NumericIntUpDown
|
||||||
|
Name="Drag_Int"
|
||||||
|
AllowDrag="True"
|
||||||
|
InnerLeftContent="Drag"
|
||||||
|
Step="1"
|
||||||
|
Watermark="Input Value"
|
||||||
|
Value="2" />
|
||||||
|
|
||||||
<!-- =================this is error usage -->
|
<!-- hex demo -->
|
||||||
<!-- HorizontalContentAlignment="Right" -->
|
|
||||||
<u:NumericUIntUpDown
|
|
||||||
AllowDrag="False"
|
|
||||||
FormatString="{}{0:x8}"
|
|
||||||
InnerLeftContent="HexNumber"
|
|
||||||
ParsingNumberStyle="HexNumber"
|
|
||||||
Step="1"
|
|
||||||
Watermark="Input Value"
|
|
||||||
Value="2" />
|
|
||||||
|
|
||||||
<!-- =================we should use AllowHexSpecifier -->
|
<u:Divider Content="{Binding #uint_HexNumber.Value, StringFormat='Don‘t Use = {0}, hex={0:X}'}" />
|
||||||
<u:NumericUIntUpDown
|
<!-- =================this is error usage -->
|
||||||
HorizontalContentAlignment="Right"
|
<u:NumericUIntUpDown
|
||||||
AllowDrag="False"
|
Name="uint_HexNumber"
|
||||||
FontFamily="Consolas"
|
AllowDrag="False"
|
||||||
FormatString="{}{0:x8}"
|
FormatString="{}{0:X8}"
|
||||||
InnerLeftContent="AllowHexSpecifier"
|
InnerLeftContent="HexNumber"
|
||||||
ParsingNumberStyle="AllowHexSpecifier"
|
ParsingNumberStyle="HexNumber"
|
||||||
Step="1"
|
Step="1"
|
||||||
Watermark="AllowHexSpecifier"
|
Watermark="Input Value"
|
||||||
Value="2" />
|
Value="2" />
|
||||||
|
|
||||||
<u:NumericUIntUpDown
|
<!-- =================we should use AllowHexSpecifier -->
|
||||||
HorizontalContentAlignment="Right"
|
<u:Divider Content="{Binding #uint_AllowHexSpecifier.Value, StringFormat='uint = {0}, hex={0:X}'}" />
|
||||||
AllowDrag="False"
|
<u:NumericUIntUpDown
|
||||||
FontFamily="Consolas"
|
Name="uint_AllowHexSpecifier"
|
||||||
FormatString="x8"
|
HorizontalContentAlignment="Right"
|
||||||
InnerLeftContent="0x"
|
AllowDrag="False"
|
||||||
ParsingNumberStyle="AllowHexSpecifier"
|
FontFamily="Consolas"
|
||||||
Step="1"
|
FormatString="{}{0:X8}"
|
||||||
Watermark="AllowHexSpecifier"
|
InnerLeftContent="AllowHexSpecifier"
|
||||||
Value="2" />
|
ParsingNumberStyle="AllowHexSpecifier"
|
||||||
<u:NumericUIntUpDown
|
Step="1"
|
||||||
HorizontalContentAlignment="Left"
|
Watermark="AllowHexSpecifier"
|
||||||
AllowDrag="False"
|
Value="2" />
|
||||||
FontFamily="Consolas"
|
|
||||||
FormatString="x8"
|
|
||||||
InnerLeftContent="0"
|
|
||||||
ParsingNumberStyle="AllowHexSpecifier"
|
|
||||||
Step="1"
|
|
||||||
Watermark="AllowHexSpecifier"
|
|
||||||
Value="2" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Grid.Column="2" HorizontalAlignment="Left">
|
|
||||||
|
|
||||||
|
<u:Divider Content="{Binding #Consolas_uint.Value, StringFormat='Font=Consolas {0}, hex={0:X}'}" />
|
||||||
|
<u:NumericUIntUpDown
|
||||||
|
Name="Consolas_uint"
|
||||||
|
HorizontalContentAlignment="Right"
|
||||||
|
AllowDrag="False"
|
||||||
|
FontFamily="Consolas"
|
||||||
|
FormatString="X8"
|
||||||
|
InnerLeftContent="0x"
|
||||||
|
ParsingNumberStyle="AllowHexSpecifier"
|
||||||
|
Step="1"
|
||||||
|
Watermark="AllowHexSpecifier"
|
||||||
|
Value="2" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<StackPanel Grid.Column="1" HorizontalAlignment="Left">
|
||||||
|
|
||||||
<Label Content="FontFamily" />
|
<Label Content="FontFamily" />
|
||||||
<TextBox Text="{Binding FontFamily}" />
|
<TextBox Text="{Binding FontFamily}" />
|
||||||
@@ -156,25 +173,5 @@
|
|||||||
<CheckBox IsChecked="{Binding IsEnable}" />
|
<CheckBox IsChecked="{Binding IsEnable}" />
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Grid.Column="1" HorizontalAlignment="Left">
|
|
||||||
<u:Divider Content="Display" />
|
|
||||||
<u:NumericUIntUpDown
|
|
||||||
Name="numd"
|
|
||||||
HorizontalContentAlignment="{Binding HorizontalContentAlignment}"
|
|
||||||
AllowDrag="{Binding AllowDrag}"
|
|
||||||
AllowSpin="{Binding AllowSpin}"
|
|
||||||
FontFamily="{Binding FontFamily}"
|
|
||||||
FormatString="{Binding FormatString}"
|
|
||||||
InnerLeftContent="{Binding InnerLeftContent}"
|
|
||||||
IsEnabled="{Binding IsEnable}"
|
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
|
||||||
Maximum="{Binding Maximum}"
|
|
||||||
Minimum="{Binding Minimum}"
|
|
||||||
ParsingNumberStyle="{Binding ParsingNumberStyle}"
|
|
||||||
ShowButtonSpinner="{Binding ShowButtonSpinner}"
|
|
||||||
Step="{Binding Step}"
|
|
||||||
Watermark="{Binding Watermark}"
|
|
||||||
Value="{Binding Value}" />
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public partial class NumericUpDownDemoViewModel : ObservableObject
|
|||||||
[ObservableProperty] private HorizontalAlignment _HorizontalContentAlignment = HorizontalAlignment.Center;
|
[ObservableProperty] private HorizontalAlignment _HorizontalContentAlignment = HorizontalAlignment.Center;
|
||||||
[ObservableProperty] private object? _InnerLeftContent = "obj:0x";
|
[ObservableProperty] private object? _InnerLeftContent = "obj:0x";
|
||||||
[ObservableProperty] private string _Watermark = "Water mark showed";
|
[ObservableProperty] private string _Watermark = "Water mark showed";
|
||||||
[ObservableProperty] private string _FormatString = "x8";
|
[ObservableProperty] private string _FormatString = "X8";
|
||||||
[ObservableProperty] private Array _Array_ParsingNumberStyle;
|
[ObservableProperty] private Array _Array_ParsingNumberStyle;
|
||||||
[ObservableProperty] private NumberStyles _ParsingNumberStyle = NumberStyles.AllowHexSpecifier;
|
[ObservableProperty] private NumberStyles _ParsingNumberStyle = NumberStyles.AllowHexSpecifier;
|
||||||
[ObservableProperty] private bool _AllowSpin = true;
|
[ObservableProperty] private bool _AllowSpin = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user