NumericUpDown.xaml 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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:DesignWidth="120"
  9. FontSize="14"
  10. Loaded="UserControl_Loaded"
  11. mc:Ignorable="d">
  12. <Border
  13. Background="{StaticResource color.field.bg.def}"
  14. BorderBrush="{StaticResource color.field.border.norm}"
  15. BorderThickness="1,1,1,1"
  16. CornerRadius="4,4,4,4">
  17. <Grid>
  18. <Grid.ColumnDefinitions>
  19. <ColumnDefinition Width="*" />
  20. <ColumnDefinition Width="1" />
  21. <ColumnDefinition Width="20" />
  22. </Grid.ColumnDefinitions>
  23. <Border />
  24. <TextBox
  25. Name="TextBox_Num"
  26. MinWidth="68"
  27. MinHeight="28"
  28. Padding="8,0,0,0"
  29. VerticalContentAlignment="Center"
  30. Background="Transparent"
  31. BorderThickness="0"
  32. FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
  33. FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
  34. Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
  35. InputMethod.IsInputMethodEnabled="False"
  36. LostFocus="TextBox_Num_LostFocus"
  37. PreviewKeyDown="TextBox_Num_PreviewKeyDown"
  38. PreviewTextInput="CountTextBox_PreviewTextInput"
  39. Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Text}"
  40. TextAlignment="Left" />
  41. <Rectangle
  42. Grid.Column="1"
  43. Margin="0,0.5,0,0.5"
  44. Fill="{StaticResource color.field.border.norm}" />
  45. <Grid Grid.Column="2" Width="20">
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="12*" />
  48. <RowDefinition Height="3*" />
  49. <RowDefinition Height="3*" />
  50. <RowDefinition Height="12*" />
  51. </Grid.RowDefinitions>
  52. <Border
  53. Grid.Row="0"
  54. Grid.RowSpan="2"
  55. Background="{StaticResource color.field.bg.def}"
  56. BorderBrush="{StaticResource color.field.border.norm}"
  57. BorderThickness="0,0,0,0.5"
  58. CornerRadius="0,4,0,0">
  59. <Button
  60. Name="Button_Add"
  61. Background="Transparent"
  62. BorderBrush="Transparent"
  63. BorderThickness="0"
  64. Click="Button_Add_Click">
  65. <Path
  66. Width="10.06"
  67. Height="5.78"
  68. 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"
  69. Fill="{StaticResource color.icon.arrow.gray.def}"
  70. Stretch="Fill"
  71. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
  72. </Button>
  73. </Border>
  74. <Border
  75. Grid.Row="2"
  76. Grid.RowSpan="2"
  77. Background="{StaticResource color.field.bg.def}"
  78. BorderBrush="{StaticResource color.field.border.norm}"
  79. BorderThickness="0,0.5,0,0"
  80. CornerRadius="0,0,4,0">
  81. <Button
  82. Name="Button_Sub"
  83. Background="Transparent"
  84. BorderThickness="00"
  85. Click="Button_Sub_Click">
  86. <Path
  87. Width="10.06"
  88. Height="5.78"
  89. 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"
  90. Fill="{StaticResource color.icon.arrow.gray.def}"
  91. Stretch="Fill"
  92. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
  93. </Button>
  94. </Border>
  95. </Grid>
  96. </Grid>
  97. </Border>
  98. </UserControl>