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