You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
4.5 KiB
62 lines
4.5 KiB
<infControls:DemoView x:Class="Samples.Modules.Calculator.Views.CalculatorUpDownView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
|
|
Title="CalculatorUpDown">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Text="The CalculatorUpDown provides a TextBox with button spinners that allow incrementing and decrementing numeric values by using the spinner buttons, keyboard up/down arrows, or mouse wheel. It also provides a Calculator dropdown which allows you to perform mathematical calculations."
|
|
TextWrapping="Wrap" />
|
|
|
|
<GroupBox Header="Features" Grid.Row="1" Margin="5" >
|
|
<Grid Margin="5" HorizontalAlignment="Left">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="Precision: " VerticalAlignment="Center" />
|
|
<extToolkit:IntegerUpDown x:Name="_precision" Grid.Column="1" Width="75" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Minimum="0" Value="2" ToolTip="Gets/Sets the maximum number of digits displayed to the right of the decimal point." />
|
|
<TextBlock Text="FormatString:" Grid.Row="1" VerticalAlignment="Center"/>
|
|
<ComboBox x:Name="_formatString" SelectedIndex="0" Grid.Row="1" Grid.Column="1" Width="150" Margin="5">
|
|
<ComboBoxItem Tag="C2">Currency</ComboBoxItem>
|
|
<ComboBoxItem Tag="F2">Fixed Point</ComboBoxItem>
|
|
<ComboBoxItem Tag="G">General</ComboBoxItem>
|
|
<ComboBoxItem Tag="N">Number</ComboBoxItem>
|
|
<ComboBoxItem Tag="P2">Percent</ComboBoxItem>
|
|
</ComboBox>
|
|
<TextBlock Text="Watermakr:" Grid.Row="2" VerticalAlignment="Center"/>
|
|
<TextBox x:Name="_watermark" Grid.Row="2" Grid.Column="1" Width="150" Margin="5" Text="Enter Value"/>
|
|
<TextBlock Grid.Column="2" Text="Increment" VerticalAlignment="Center" />
|
|
<TextBlock Grid.Column="2" Grid.Row="1" Text="Minimum" VerticalAlignment="Center" />
|
|
<TextBlock Grid.Column="2" Grid.Row="2" Text="Maximum" VerticalAlignment="Center" />
|
|
<extToolkit:IntegerUpDown Grid.Column="3" Name="_increment" Minimum="0" Value="1" VerticalAlignment="Center" Margin="5" Width="150" />
|
|
<extToolkit:IntegerUpDown Grid.Column="3" Grid.Row="1" Name="_minimum" Value="-100" VerticalAlignment="Center" Margin="5" Width="150" />
|
|
<extToolkit:IntegerUpDown Grid.Column="3" Grid.Row="2" Name="_maximum" Value="5000" VerticalAlignment="Center" Margin="5" Width="150" />
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<StackPanel Grid.Row="2" Margin="10" HorizontalAlignment="Left">
|
|
<TextBlock Text="Usage:" Style="{StaticResource Header}" />
|
|
<extToolkit:CalculatorUpDown Margin="10" Width="250"
|
|
Increment="{Binding Value, ElementName=_increment}"
|
|
Maximum="{Binding Value, ElementName=_maximum}"
|
|
Minimum="{Binding Value, ElementName=_minimum}"
|
|
Precision="{Binding Value, ElementName=_precision}"
|
|
FormatString="{Binding SelectedItem.Tag, ElementName=_formatString}"
|
|
Watermark="{Binding Text, ElementName=_watermark}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</infControls:DemoView>
|
|
|