NumericUpDown.xaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <UserControl
  2. x:Class="PDF_Office.CustomControl.NumericUpDown"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PDF_Office.CustomControl"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. d:DesignHeight="32"
  9. d:DesignWidth="80"
  10. Background="#EEEEEE"
  11. FontSize="20"
  12. mc:Ignorable="d">
  13. <Border>
  14. <Grid>
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition Width="*" />
  17. <ColumnDefinition Width="auto" />
  18. </Grid.ColumnDefinitions>
  19. <TextBox
  20. Name="TextBox_Num"
  21. MinWidth="80"
  22. MinHeight="32"
  23. Padding="16,0,0,0"
  24. VerticalContentAlignment="Center"
  25. Background="Transparent"
  26. BorderThickness="0"
  27. FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
  28. FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
  29. Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
  30. InputMethod.IsInputMethodEnabled="False"
  31. PreviewTextInput="CountTextBox_PreviewTextInput"
  32. Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Text}"
  33. TextAlignment="Left"
  34. TextChanged="TextBox_Num_TextChanged" />
  35. <Grid Grid.Column="1" Width="16">
  36. <Grid.RowDefinitions>
  37. <RowDefinition />
  38. <RowDefinition />
  39. </Grid.RowDefinitions>
  40. <Button
  41. Name="Button_Add"
  42. Grid.Row="0"
  43. Background="Transparent"
  44. BorderBrush="Transparent"
  45. BorderThickness="0"
  46. Click="Button_Add_Click">
  47. <Path
  48. HorizontalAlignment="Center"
  49. Data="M8 4.29102L2.14648 10.1445L2.85547 10.8535L8 5.70898L13.1445 10.8535L13.8535 10.1445L8 4.29102Z"
  50. Fill="Black"
  51. Stretch="Uniform"
  52. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
  53. </Button>
  54. <Button
  55. Name="Button_Sub"
  56. Grid.Row="1"
  57. Background="Transparent"
  58. BorderThickness="00"
  59. Click="Button_Sub_Click">
  60. <Path
  61. Data="M13.8535 5.85547L13.1445 5.14648L8 10.291L2.85547 5.14648L2.14648 5.85547L8 11.709L13.8535 5.85547Z"
  62. Fill="Black"
  63. Stretch="Uniform"
  64. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
  65. </Button>
  66. </Grid>
  67. </Grid>
  68. </Border>
  69. </UserControl>