NumericUpDown.xaml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <UserControl
  2. x:Class="PDF_Master.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_Master.CustomControl"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. d:DesignHeight="32"
  9. d:DesignWidth="80"
  10. FontSize="20"
  11. mc:Ignorable="d">
  12. <Border>
  13. <Grid>
  14. <Grid.ColumnDefinitions>
  15. <ColumnDefinition Width="*" />
  16. <ColumnDefinition Width="auto" />
  17. </Grid.ColumnDefinitions>
  18. <Border
  19. Background="{StaticResource color.field.bg.def}"
  20. BorderBrush="{StaticResource color.field.border.norm}"
  21. BorderThickness="1,1,0,1"
  22. CornerRadius="4,0,0,4" />
  23. <TextBox
  24. Name="TextBox_Num"
  25. MinWidth="80"
  26. MinHeight="32"
  27. Padding="16,0,0,0"
  28. VerticalContentAlignment="Center"
  29. Background="Transparent"
  30. BorderThickness="0"
  31. FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
  32. FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
  33. Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
  34. InputMethod.IsInputMethodEnabled="False"
  35. PreviewTextInput="CountTextBox_PreviewTextInput"
  36. Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Text}"
  37. TextAlignment="Left"
  38. TextChanged="TextBox_Num_TextChanged" />
  39. <Grid Grid.Column="1" Width="16">
  40. <Grid.RowDefinitions>
  41. <RowDefinition />
  42. <RowDefinition />
  43. </Grid.RowDefinitions>
  44. <Border
  45. Grid.Row="0"
  46. Background="{StaticResource color.field.bg.def}"
  47. BorderBrush="{StaticResource color.field.border.norm}"
  48. BorderThickness="1,1,1,0.5"
  49. CornerRadius="0,4,0,0">
  50. <Button
  51. Name="Button_Add"
  52. Background="Transparent"
  53. BorderBrush="Transparent"
  54. BorderThickness="0"
  55. Click="Button_Add_Click">
  56. <Path
  57. HorizontalAlignment="Center"
  58. Data="M10 5.93571L13.9696 9.90532L15.0303 8.84466L10.5303 4.34472C10.2374 4.05183 9.76257 4.05183 9.46967 4.34472L4.96974 8.84466L6.0304 9.90532L10 5.93571Z"
  59. Fill="{StaticResource color.icon.arrow.gray.def}"
  60. Stretch="Uniform"
  61. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
  62. </Button>
  63. </Border>
  64. <Border
  65. Grid.Row="1"
  66. Background="{StaticResource color.field.bg.def}"
  67. BorderBrush="{StaticResource color.field.border.norm}"
  68. BorderThickness="1,0.5,1,1"
  69. CornerRadius="0,0,4,0">
  70. <Button
  71. Name="Button_Sub"
  72. Background="Transparent"
  73. BorderThickness="00"
  74. Click="Button_Sub_Click">
  75. <Path
  76. Data="M10 9.06427L6.03039 5.09467L4.96973 6.15533L9.46967 10.6553C9.76256 10.9482 10.2374 10.9482 10.5303 10.6553L15.0303 6.15533L13.9696 5.09467L10 9.06427Z"
  77. Fill="{StaticResource color.icon.arrow.gray.def}"
  78. Stretch="Uniform"
  79. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
  80. </Button>
  81. </Border>
  82. </Grid>
  83. </Grid>
  84. </Border>
  85. </UserControl>