CPDFFontUI.xaml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <UserControl x:Class="Compdfkit_Tools.Common.CPDFFontUI"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:Compdfkit_Tools.Common"
  7. mc:Ignorable="d"
  8. d:DesignHeight="120" d:DesignWidth="228">
  9. <UserControl.Resources>
  10. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  11. <Setter Property="BorderThickness" Value="1" />
  12. <Setter Property="Foreground" Value="#252629" />
  13. <Setter Property="Template">
  14. <Setter.Value>
  15. <ControlTemplate TargetType="{x:Type RadioButton}">
  16. <Border
  17. x:Name="templateRoot"
  18. Background="{TemplateBinding Background}"
  19. SnapsToDevicePixels="True">
  20. <ContentPresenter
  21. x:Name="contentPresenter"
  22. Grid.Column="1"
  23. Margin="{TemplateBinding Padding}"
  24. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  25. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  26. Focusable="False"
  27. RecognizesAccessKey="True"
  28. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  29. </Border>
  30. <ControlTemplate.Triggers>
  31. <Trigger Property="IsEnabled" Value="false">
  32. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  33. </Trigger>
  34. <Trigger Property="IsMouseOver" Value="True">
  35. <Setter Property="Background" Value="#294982E6"></Setter>
  36. </Trigger>
  37. <Trigger Property="IsPressed" Value="true">
  38. <Setter Property="Background" Value="#604982E6"></Setter>
  39. </Trigger>
  40. <Trigger Property="IsChecked" Value="true">
  41. <Setter Property="Background" Value="#294982E6"></Setter>
  42. </Trigger>
  43. </ControlTemplate.Triggers>
  44. </ControlTemplate>
  45. </Setter.Value>
  46. </Setter>
  47. </Style>
  48. </UserControl.Resources>
  49. <Grid>
  50. <Grid.RowDefinitions>
  51. <RowDefinition></RowDefinition>
  52. <RowDefinition></RowDefinition>
  53. <RowDefinition></RowDefinition>
  54. </Grid.RowDefinitions>
  55. <Grid>
  56. <ComboBox x:Name="FontFamilyComboBox" SelectionChanged="FontFamilyComboBox_SelectionChanged" Width="228" Height="28" Margin="0,0,0,4"></ComboBox>
  57. <TextBox x:Name="FontFamilyTextBox" IsHitTestVisible="False" Width="228" Height="28" VerticalContentAlignment="Center" IsReadOnly="True" Background="#FFFFFF" Padding="0,0,15,0" Margin="0,0,0,4">Helvetica</TextBox>
  58. <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
  59. <Path.Data>
  60. M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
  61. </Path.Data>
  62. </Path>
  63. </Grid>
  64. <Grid Grid.Row="1" Margin="0,4,0,0">
  65. <Grid.ColumnDefinitions>
  66. <ColumnDefinition Width="auto"></ColumnDefinition>
  67. <ColumnDefinition></ColumnDefinition>
  68. </Grid.ColumnDefinitions>
  69. <Grid Margin="0,0,8,0">
  70. <ComboBox x:Name="FontStyleComboBox" SelectionChanged="FontStyleComboBox_SelectionChanged" Width="148" Height="28" BorderBrush="#1E000000" ></ComboBox>
  71. <TextBox x:Name="FontStyleTextBox" IsHitTestVisible="False" Width="148" Height="28" VerticalContentAlignment="Center" IsReadOnly="True" Background="#FFFFFF" Padding="0,0,15,0" >Common</TextBox>
  72. <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
  73. <Path.Data>
  74. M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
  75. </Path.Data>
  76. </Path>
  77. </Grid>
  78. <local:DropDownNumberBoxControl x:Name="FontSizeComboBox" Maxium="100" Minimum="1" Grid.Column="1" Width="72" Height="28" Unit="pt" Text="{Binding FontSizeValue,Mode=TwoWay}"></local:DropDownNumberBoxControl>
  79. </Grid>
  80. <Border BorderBrush="#E2E3E6" BorderThickness="1" Width="148" Grid.Row="2" HorizontalAlignment="Left" Margin="0,8,0,0">
  81. <Grid>
  82. <Grid.ColumnDefinitions>
  83. <ColumnDefinition></ColumnDefinition>
  84. <ColumnDefinition></ColumnDefinition>
  85. <ColumnDefinition></ColumnDefinition>
  86. </Grid.ColumnDefinitions>
  87. <RadioButton x:Name="LeftAlignRadioButton" Tag="Left" Style="{StaticResource GreyBgRadioBtnStyle}" IsChecked="True" Checked="AlignRadioButton_Checked">
  88. <RadioButton.Content>
  89. <Grid Width="48" Height="30">
  90. <Canvas Margin="16,10,0,0">
  91. <Rectangle
  92. Width="13"
  93. Height="1.5"
  94. Stroke="#000000"
  95. StrokeThickness="1.5" />
  96. <Rectangle
  97. Canvas.Top="4"
  98. Width="16"
  99. Height="1.5"
  100. Stroke="#000000"
  101. StrokeThickness="1.5" />
  102. <Rectangle
  103. Canvas.Top="8"
  104. Width="12"
  105. Height="1.5"
  106. Stroke="#000000"
  107. StrokeThickness="1.5" />
  108. </Canvas>
  109. </Grid>
  110. </RadioButton.Content>
  111. </RadioButton>
  112. <RadioButton x:Name="CenterAlignRadioButton" Grid.Column="1" Style="{StaticResource GreyBgRadioBtnStyle}" Tag="Center" Checked="AlignRadioButton_Checked">
  113. <RadioButton.Content>
  114. <Grid Width="48" Height="30">
  115. <Canvas Margin="16,10,0,0">
  116. <Rectangle
  117. Width="16"
  118. Height="1.5"
  119. Stroke="#000000"
  120. StrokeThickness="1.5" />
  121. <Rectangle
  122. Canvas.Top="4"
  123. Width="10"
  124. Height="1.5"
  125. Stroke="#000000"
  126. StrokeThickness="1.5"
  127. Margin="3,0,0,0"/>
  128. <Rectangle
  129. Canvas.Top="8"
  130. Width="16"
  131. Height="1.5"
  132. Stroke="#000000"
  133. StrokeThickness="1.5" />
  134. </Canvas>
  135. </Grid>
  136. </RadioButton.Content>
  137. </RadioButton>
  138. <RadioButton x:Name="RightAlignRadioButton" Grid.Column="2" Style="{StaticResource GreyBgRadioBtnStyle}" Tag="Right" Checked="AlignRadioButton_Checked">
  139. <RadioButton.Content >
  140. <Grid Width="48" Height="30">
  141. <Canvas Margin="13,10,0,0">
  142. <Rectangle
  143. Width="13"
  144. Height="1.5"
  145. Stroke="#000000"
  146. StrokeThickness="1.5"
  147. Margin="3,0,0,0"/>
  148. <Rectangle
  149. Canvas.Top="4"
  150. Width="16"
  151. Height="1.5"
  152. Stroke="#000000"
  153. StrokeThickness="1.5"/>
  154. <Rectangle
  155. Canvas.Top="8"
  156. Width="13"
  157. Height="1.5"
  158. Stroke="#000000"
  159. StrokeThickness="1.5"
  160. Margin="3,0,0,0"/>
  161. </Canvas>
  162. </Grid>
  163. </RadioButton.Content>
  164. </RadioButton>
  165. </Grid>
  166. </Border>
  167. </Grid>
  168. </UserControl>