NumericUpDown.xaml 1.6 KB

12345678910111213141516171819202122232425262728
  1. <UserControl x:Class="CustomControls.NumericUpDown"
  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:CustomControls"
  7. mc:Ignorable="d"
  8. d:DesignHeight="25" d:DesignWidth="100">
  9. <Grid Background="Transparent">
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="*"/>
  12. <RowDefinition Height="*"/>
  13. </Grid.RowDefinitions>
  14. <Grid.ColumnDefinitions>
  15. <ColumnDefinition Width="*"/>
  16. <ColumnDefinition Width="Auto"/>
  17. </Grid.ColumnDefinitions>
  18. <TextBox Name="tbmain" Grid.ColumnSpan="2" Grid.RowSpan="2" Padding="0,2,0,2"
  19. Text="{Binding Path=FormattedValue, RelativeSource={RelativeSource AncestorType={x:Type local:NumericUpDown}}}" KeyDown="tbmain_KeyDown" />
  20. <RepeatButton Name="btnUp" BorderThickness="0" BorderBrush="Transparent" Grid.Column="1" Grid.Row="0" Background="Transparent" Click="btnUp_Click" Margin="0,1,1,0">
  21. <Path Fill="Black" Data="M 0 3 L 6 3 L 3 0 Z"/>
  22. </RepeatButton>
  23. <RepeatButton Name="btnDown" BorderThickness="0" BorderBrush="Transparent" Grid.Column="1" Grid.Row="1" Width="13" Background="Transparent" Click="btnDown_Click" Margin="0,0,1,1">
  24. <Path Fill="Black" Data="M 0 0 L 3 3 L 6 0 Z"/>
  25. </RepeatButton>
  26. </Grid>
  27. </UserControl>