NumericUpDown.xaml 4.8 KB

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