NumbericUpDown.xaml 1.4 KB

123456789101112131415161718192021222324
  1. <UserControl x:Class="MECF.Framework.UI.Core.Control.NumbericUpDown"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:MECF.Framework.UI.Core.Control"
  7. mc:Ignorable="d" x:Name="self"
  8. d:DesignHeight="35" d:DesignWidth="200">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="*"></RowDefinition>
  12. <RowDefinition Height="*"></RowDefinition>
  13. </Grid.RowDefinitions>
  14. <Grid.ColumnDefinitions>
  15. <ColumnDefinition Width="*"></ColumnDefinition>
  16. <ColumnDefinition Width="20"></ColumnDefinition>
  17. </Grid.ColumnDefinitions>
  18. <TextBox Name="txtInput" VerticalContentAlignment="Center" Grid.Row="0" Grid.RowSpan="2" Text="{Binding ElementName=self,Path=Value,StringFormat={}{0:F2}}"
  19. PreviewTextInput="OnPreviewTextInput" InputMethod.IsInputMethodEnabled="False" TextChanged="TextBox_TextChanged"></TextBox>
  20. <Button Focusable="true" Content="▲" Grid.Row="0" Grid.Column="1" Click="Up_Click"></Button>
  21. <Button Focusable="True" Content="▼" Grid.Row="1" Grid.Column="1" Click="Down_Click"></Button>
  22. </Grid>
  23. </UserControl>