181 lines
6.5 KiB
XML
181 lines
6.5 KiB
XML
<UserControl
|
|
x:Class="Ursa.Demo.Pages.NumericUpDownDemo"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:u="https://irihi.tech/ursa"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
mc:Ignorable="d">
|
|
|
|
<UserControl.Styles>
|
|
<Style Selector=":is(u|NumericUpDown)">
|
|
<Setter Property="Width" Value="240" />
|
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
|
</Style>
|
|
</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
|
|
AllowDrag="True"
|
|
InnerLeftContent="Drag"
|
|
Step="1"
|
|
Watermark="Input Value"
|
|
Value="2" />
|
|
|
|
<!-- hex demo -->
|
|
|
|
<!-- =================this is error usage -->
|
|
<!-- 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:NumericUIntUpDown
|
|
HorizontalContentAlignment="Right"
|
|
AllowDrag="False"
|
|
FontFamily="Consolas"
|
|
FormatString="{}{0:x8}"
|
|
InnerLeftContent="AllowHexSpecifier"
|
|
ParsingNumberStyle="AllowHexSpecifier"
|
|
Step="1"
|
|
Watermark="AllowHexSpecifier"
|
|
Value="2" />
|
|
|
|
<u:NumericUIntUpDown
|
|
HorizontalContentAlignment="Right"
|
|
AllowDrag="False"
|
|
FontFamily="Consolas"
|
|
FormatString="x8"
|
|
InnerLeftContent="0x"
|
|
ParsingNumberStyle="AllowHexSpecifier"
|
|
Step="1"
|
|
Watermark="AllowHexSpecifier"
|
|
Value="2" />
|
|
<u:NumericUIntUpDown
|
|
HorizontalContentAlignment="Left"
|
|
AllowDrag="False"
|
|
FontFamily="Consolas"
|
|
FormatString="x8"
|
|
InnerLeftContent="0"
|
|
ParsingNumberStyle="AllowHexSpecifier"
|
|
Step="1"
|
|
Watermark="AllowHexSpecifier"
|
|
Value="2" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Column="2" HorizontalAlignment="Left">
|
|
|
|
|
|
<Label Content="FontFamily" />
|
|
<TextBox Text="{Binding FontFamily}" />
|
|
|
|
<Label Content="AllowDrag" />
|
|
<CheckBox IsChecked="{Binding AllowDrag}" />
|
|
|
|
<Label Content="IsReadOnly" />
|
|
<CheckBox IsChecked="{Binding IsReadOnly}" />
|
|
|
|
<Label Content="HorizontalContentAlignment" />
|
|
<ComboBox ItemsSource="{Binding Array_HorizontalContentAlignment}" SelectedItem="{Binding HorizontalContentAlignment}" />
|
|
|
|
<Label Content="InnerLeftContent" />
|
|
<TextBox Text="{Binding InnerLeftContent}" />
|
|
|
|
|
|
<Label Content="Watermark" />
|
|
<TextBox Text="{Binding Watermark}" />
|
|
|
|
|
|
<Label Content="FormatString" />
|
|
<TextBox
|
|
MinWidth="100"
|
|
MaxLength="100"
|
|
Text="{Binding FormatString}" />
|
|
|
|
<Label Content="ParsingNumberStyle" />
|
|
<ComboBox ItemsSource="{Binding Array_ParsingNumberStyle}" SelectedItem="{Binding ParsingNumberStyle}" />
|
|
|
|
|
|
<Label Content="AllowSpin" />
|
|
<CheckBox IsChecked="{Binding AllowSpin}" />
|
|
|
|
<Label Content="ShowButtonSpinner" />
|
|
<CheckBox IsChecked="{Binding ShowButtonSpinner}" />
|
|
|
|
<u:NumericUIntUpDown
|
|
Name="nudV"
|
|
AllowSpin="True"
|
|
InnerLeftContent="Value"
|
|
IsEnabled="True"
|
|
IsReadOnly="False"
|
|
Value="{Binding Value, Mode=TwoWay}" />
|
|
|
|
<u:NumericUIntUpDown InnerLeftContent="Max" Value="{Binding Maximum}" />
|
|
|
|
<u:NumericUIntUpDown InnerLeftContent="Min" Value="{Binding Minimum}" />
|
|
|
|
<Label Content="Step" />
|
|
<Slider Minimum="1" Value="{Binding Step}" />
|
|
|
|
<Label Content="IsEnable" />
|
|
<CheckBox IsChecked="{Binding IsEnable}" />
|
|
|
|
</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>
|
|
</UserControl>
|