CPDFFontUI.xaml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. <ResourceDictionary>
  11. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  12. <Setter Property="BorderThickness" Value="1" />
  13. <Setter Property="Foreground" Value="#252629" />
  14. <Setter Property="Template">
  15. <Setter.Value>
  16. <ControlTemplate TargetType="{x:Type RadioButton}">
  17. <Border
  18. x:Name="templateRoot"
  19. Background="{TemplateBinding Background}"
  20. SnapsToDevicePixels="True">
  21. <ContentPresenter
  22. x:Name="contentPresenter"
  23. Grid.Column="1"
  24. Margin="{TemplateBinding Padding}"
  25. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  26. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  27. Focusable="False"
  28. RecognizesAccessKey="True"
  29. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  30. </Border>
  31. <ControlTemplate.Triggers>
  32. <Trigger Property="IsEnabled" Value="false">
  33. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  34. </Trigger>
  35. <Trigger Property="IsMouseOver" Value="True">
  36. <Setter Property="Background" Value="#294982E6"></Setter>
  37. </Trigger>
  38. <Trigger Property="IsPressed" Value="true">
  39. <Setter Property="Background" Value="#604982E6"></Setter>
  40. </Trigger>
  41. <Trigger Property="IsChecked" Value="true">
  42. <Setter Property="Background" Value="#294982E6"></Setter>
  43. </Trigger>
  44. </ControlTemplate.Triggers>
  45. </ControlTemplate>
  46. </Setter.Value>
  47. </Setter>
  48. </Style>
  49. <ResourceDictionary.MergedDictionaries>
  50. <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
  51. </ResourceDictionary.MergedDictionaries>
  52. </ResourceDictionary>
  53. </UserControl.Resources>
  54. <Grid>
  55. <Grid.RowDefinitions>
  56. <RowDefinition></RowDefinition>
  57. <RowDefinition></RowDefinition>
  58. <RowDefinition></RowDefinition>
  59. </Grid.RowDefinitions>
  60. <Grid>
  61. <ComboBox x:Name="FontFamilyComboBox" SelectionChanged="FontFamilyComboBox_SelectionChanged" Style="{StaticResource ComboBoxStyle1}" Width="228" Height="28" Margin="0,0,0,4" ></ComboBox>
  62. </Grid>
  63. <Grid Grid.Row="1" Margin="0,4,0,0" HorizontalAlignment="Left" Width="228">
  64. <Grid.ColumnDefinitions>
  65. <ColumnDefinition Width="auto"></ColumnDefinition>
  66. <ColumnDefinition></ColumnDefinition>
  67. </Grid.ColumnDefinitions>
  68. <Grid Margin="0,0,8,0">
  69. <ComboBox x:Name="FontStyleComboBox" Style="{StaticResource ComboBoxStyle1}" SelectionChanged="FontStyleComboBox_SelectionChanged" Width="148" Height="28" BorderBrush="#1E000000" ></ComboBox>
  70. </Grid>
  71. <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>
  72. </Grid>
  73. <Border BorderBrush="#E2E3E6" BorderThickness="1" Width="148" Grid.Row="2" HorizontalAlignment="Left" Margin="0,8,0,0">
  74. <Grid>
  75. <Grid.ColumnDefinitions>
  76. <ColumnDefinition></ColumnDefinition>
  77. <ColumnDefinition></ColumnDefinition>
  78. <ColumnDefinition></ColumnDefinition>
  79. </Grid.ColumnDefinitions>
  80. <RadioButton x:Name="LeftAlignRadioButton" Tag="Left" Style="{StaticResource GreyBgRadioBtnStyle}" IsChecked="True" Checked="AlignRadioButton_Checked">
  81. <RadioButton.Content>
  82. <Grid Width="48" Height="30">
  83. <Canvas Margin="16,10,0,0">
  84. <Rectangle
  85. Width="13"
  86. Height="1.5"
  87. Stroke="#000000"
  88. StrokeThickness="1.5" />
  89. <Rectangle
  90. Canvas.Top="4"
  91. Width="16"
  92. Height="1.5"
  93. Stroke="#000000"
  94. StrokeThickness="1.5" />
  95. <Rectangle
  96. Canvas.Top="8"
  97. Width="12"
  98. Height="1.5"
  99. Stroke="#000000"
  100. StrokeThickness="1.5" />
  101. </Canvas>
  102. </Grid>
  103. </RadioButton.Content>
  104. </RadioButton>
  105. <RadioButton x:Name="CenterAlignRadioButton" Grid.Column="1" Style="{StaticResource GreyBgRadioBtnStyle}" Tag="Center" Checked="AlignRadioButton_Checked">
  106. <RadioButton.Content>
  107. <Grid Width="48" Height="30">
  108. <Canvas Margin="16,10,0,0">
  109. <Rectangle
  110. Width="16"
  111. Height="1.5"
  112. Stroke="#000000"
  113. StrokeThickness="1.5" />
  114. <Rectangle
  115. Canvas.Top="4"
  116. Width="10"
  117. Height="1.5"
  118. Stroke="#000000"
  119. StrokeThickness="1.5"
  120. Margin="3,0,0,0"/>
  121. <Rectangle
  122. Canvas.Top="8"
  123. Width="16"
  124. Height="1.5"
  125. Stroke="#000000"
  126. StrokeThickness="1.5" />
  127. </Canvas>
  128. </Grid>
  129. </RadioButton.Content>
  130. </RadioButton>
  131. <RadioButton x:Name="RightAlignRadioButton" Grid.Column="2" Style="{StaticResource GreyBgRadioBtnStyle}" Tag="Right" Checked="AlignRadioButton_Checked">
  132. <RadioButton.Content >
  133. <Grid Width="48" Height="30">
  134. <Canvas Margin="13,10,0,0">
  135. <Rectangle
  136. Width="13"
  137. Height="1.5"
  138. Stroke="#000000"
  139. StrokeThickness="1.5"
  140. Margin="3,0,0,0"/>
  141. <Rectangle
  142. Canvas.Top="4"
  143. Width="16"
  144. Height="1.5"
  145. Stroke="#000000"
  146. StrokeThickness="1.5"/>
  147. <Rectangle
  148. Canvas.Top="8"
  149. Width="13"
  150. Height="1.5"
  151. Stroke="#000000"
  152. StrokeThickness="1.5"
  153. Margin="3,0,0,0"/>
  154. </Canvas>
  155. </Grid>
  156. </RadioButton.Content>
  157. </RadioButton>
  158. </Grid>
  159. </Border>
  160. </Grid>
  161. </UserControl>