|
|
@@ -0,0 +1,96 @@
|
|
|
+<UserControl xmlns="https://github.com/avaloniaui"
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
+ <StackPanel Orientation="Vertical" Gap="4">
|
|
|
+ <TextBlock Margin="2" Classes="h1">Numeric up-down controls</TextBlock>
|
|
|
+ <TextBlock Margin="2" Classes="h2" TextWrapping="Wrap">Numeric up-down controls provide a TextBox with button spinners that allow incrementing and decrementing numeric values by using the spinner buttons, keyboard up/down arrows, or mouse wheel.</TextBlock>
|
|
|
+ <TextBlock Margin="2" Classes="h2">The following controls are available to support various native numeric types:</TextBlock>
|
|
|
+ <TextBlock Margin="2" Classes="h2">ByteUpDown, ShortUpDown, IntegerUpDown, LongUpDown, SingleUpDown, DoubleUpDown, DecimalUpDown.</TextBlock>
|
|
|
+
|
|
|
+ <TextBlock Margin="2,5,2,2" FontSize="14" FontWeight="Bold">Features:</TextBlock>
|
|
|
+ <Grid Margin="2" ColumnDefinitions="Auto,Auto,Auto,Auto" RowDefinitions="Auto,Auto">
|
|
|
+ <Grid Grid.Row="0" Grid.Column="0" ColumnDefinitions="Auto, Auto" RowDefinitions="35,35,35,35,35">
|
|
|
+ <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="2">ShowButtonSpinner:</TextBlock>
|
|
|
+ <CheckBox Grid.Row="0" Grid.Column="1" IsChecked="{Binding #doubleUpDown.ShowButtonSpinner}" VerticalAlignment="Center" Margin="2"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="2">IsReadOnly:</TextBlock>
|
|
|
+ <CheckBox Grid.Row="1" Grid.Column="1" IsChecked="{Binding #doubleUpDown.IsReadOnly}" VerticalAlignment="Center" Margin="2"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="2">AllowSpin:</TextBlock>
|
|
|
+ <CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding #doubleUpDown.AllowSpin}" IsEnabled="{Binding #doubleUpDown.!IsReadOnly}" VerticalAlignment="Center" Margin="2"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Margin="2">ClipValueToMinMax:</TextBlock>
|
|
|
+ <CheckBox Grid.Row="3" Grid.Column="1" IsChecked="{Binding #doubleUpDown.ClipValueToMinMax}" VerticalAlignment="Center" Margin="2"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="2">DisplayDefaultValueOnEmptyText:</TextBlock>
|
|
|
+ <CheckBox Grid.Row="4" Grid.Column="1" IsChecked="{Binding #doubleUpDown.DisplayDefaultValueOnEmptyText}" VerticalAlignment="Center" Margin="2"/>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="0" Grid.Column="1" Margin="10,2,2,2" ColumnDefinitions="Auto, 120" RowDefinitions="35,35,35,35,35">
|
|
|
+ <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="2">FormatString:</TextBlock>
|
|
|
+ <DropDown Grid.Row="0" Grid.Column="1" Items="{Binding Formats}" SelectedItem="{Binding SelectedFormat}"
|
|
|
+ VerticalAlignment="Center" Margin="2">
|
|
|
+ <DropDown.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <StackPanel Orientation="Horizontal" Gap="2">
|
|
|
+ <TextBlock Text="{Binding Name}"/>
|
|
|
+ <TextBlock Text="-"/>
|
|
|
+ <TextBlock Text="{Binding Value}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </DataTemplate>
|
|
|
+ </DropDown.ItemTemplate>
|
|
|
+ </DropDown>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="2">ButtonSpinnerLocation:</TextBlock>
|
|
|
+ <DropDown Grid.Row="1" Grid.Column="1" Items="{Binding SpinnerLocations}" SelectedItem="{Binding #doubleUpDown.ButtonSpinnerLocation}"
|
|
|
+ VerticalAlignment="Center" Margin="2"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="2">CultureInfo:</TextBlock>
|
|
|
+ <DropDown Grid.Row="2" Grid.Column="1" Items="{Binding Cultures}" SelectedItem="{Binding #doubleUpDown.CultureInfo}"
|
|
|
+ VerticalAlignment="Center" Margin="2"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Margin="2">Watermark:</TextBlock>
|
|
|
+ <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding #doubleUpDown.Watermark}" VerticalAlignment="Center" Margin="2" />
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="2">Text:</TextBlock>
|
|
|
+ <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding #doubleUpDown.Text}" VerticalAlignment="Center" Margin="2" />
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="0" Grid.Column="2" Margin="10,2,2,2" RowDefinitions="35,35,35,35,35" ColumnDefinitions="Auto, 120">
|
|
|
+ <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Minimum:</TextBlock>
|
|
|
+ <DoubleUpDown Grid.Row="0" Grid.Column="1" Value="{Binding #doubleUpDown.Minimum}" AllowInputSpecialValues="NegativeInfinity"
|
|
|
+ CultureInfo="{Binding #doubleUpDown.CultureInfo}" VerticalAlignment="Center" Height="25" Margin="2" Width="70" HorizontalAlignment="Center"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Maximum:</TextBlock>
|
|
|
+ <DoubleUpDown Grid.Row="1" Grid.Column="1" Value="{Binding #doubleUpDown.Maximum}" AllowInputSpecialValues="PositiveInfinity"
|
|
|
+ CultureInfo="{Binding #doubleUpDown.CultureInfo}" VerticalAlignment="Center" Height="25" Margin="2" Width="70" HorizontalAlignment="Center"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Increment:</TextBlock>
|
|
|
+ <DoubleUpDown Grid.Row="2" Grid.Column="1" Value="{Binding #doubleUpDown.Increment}" VerticalAlignment="Center"
|
|
|
+ Height="25" Margin="2" Width="70" HorizontalAlignment="Center"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">Value:</TextBlock>
|
|
|
+ <DoubleUpDown Grid.Row="3" Grid.Column="1" Value="{Binding #doubleUpDown.Value}" VerticalAlignment="Center"
|
|
|
+ Height="25" Margin="2" Width="70" HorizontalAlignment="Center"/>
|
|
|
+
|
|
|
+ <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="10,2,2,2">DefaultValue:</TextBlock>
|
|
|
+ <DoubleUpDown Grid.Row="4" Grid.Column="1" Value="{Binding #doubleUpDown.DefaultValue}" AllowInputSpecialValues="Any"
|
|
|
+ VerticalAlignment="Center" Height="25" Margin="2" Width="70" HorizontalAlignment="Center"/>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <TextBlock Margin="2" Classes="h2">DoubleUpDown and SingleUpDown support the AllowInputSpecialValues property</TextBlock>
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="2">AllowInputSpecialValues:</TextBlock>
|
|
|
+ <DropDown Grid.Row="1" Grid.Column="1" Items="{Binding AllowedSpecialValues}" SelectedItem="{Binding #doubleUpDown.AllowInputSpecialValues}"
|
|
|
+ VerticalAlignment="Center" Margin="2"/>
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ <StackPanel Margin="2,10,2,2" Orientation="Horizontal" Gap="10">
|
|
|
+ <TextBlock FontSize="14" FontWeight="Bold" VerticalAlignment="Center">Usage of DoubleUpDown:</TextBlock>
|
|
|
+ <DoubleUpDown Name="doubleUpDown" Minimum="0" Maximum="10" Increment="0.5"
|
|
|
+ AllowInputSpecialValues="Any" CultureInfo="en-US"
|
|
|
+ VerticalAlignment="Center" Height="25" Width="100"
|
|
|
+ Watermark="Enter text" FormatString="{Binding SelectedFormat.Value}"/>
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ </StackPanel>
|
|
|
+</UserControl>
|