Generic.xaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:cus="clr-namespace:PDF_Master.CustomControl">
  5. <!-- style for customControl -->
  6. <Style TargetType="{x:Type cus:DialogContent}">
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="{x:Type cus:DialogContent}">
  10. <Border Background="White" CornerRadius="8">
  11. <Grid Background="Transparent">
  12. <Grid.RowDefinitions>
  13. <RowDefinition Height="50" />
  14. <RowDefinition Height="*" />
  15. <RowDefinition Height="64" />
  16. </Grid.RowDefinitions>
  17. <Border Background="Transparent">
  18. <TextBlock
  19. Margin="16,0"
  20. VerticalAlignment="Center"
  21. FontSize="16"
  22. FontWeight="SemiBold"
  23. Text="{TemplateBinding Header}" />
  24. </Border>
  25. <ContentPresenter
  26. Grid.Row="1"
  27. Content="{TemplateBinding Content}"
  28. Focusable="False"
  29. RecognizesAccessKey="True"
  30. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  31. <Border Grid.Row="2">
  32. <ContentControl Content="{TemplateBinding BottmBar}" />
  33. </Border>
  34. </Grid>
  35. </Border>
  36. </ControlTemplate>
  37. </Setter.Value>
  38. </Setter>
  39. </Style>
  40. <Style TargetType="{x:Type cus:TextBoxEx}">
  41. <Setter Property="Background" Value="{StaticResource color.field.bg.def}" />
  42. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  43. <Setter Property="Foreground" Value="Black" />
  44. <Setter Property="VerticalContentAlignment" Value="Center" />
  45. <Setter Property="HorizontalContentAlignment" Value="Left" />
  46. <Setter Property="BorderThickness" Value="1" />
  47. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  48. <Setter Property="Height" Value="32" />
  49. <Setter Property="Padding" Value="3 0"/>
  50. <Setter Property="CornerRadius" Value="4" />
  51. <Setter Property="Template">
  52. <Setter.Value>
  53. <ControlTemplate TargetType="{x:Type cus:TextBoxEx}">
  54. <Border
  55. x:Name="border"
  56. Width="{TemplateBinding Width}"
  57. Height="{TemplateBinding Height}"
  58. Background="{TemplateBinding Background}"
  59. BorderBrush="{TemplateBinding BorderBrush}"
  60. BorderThickness="{TemplateBinding BorderThickness}"
  61. CornerRadius="{TemplateBinding CornerRadius}"
  62. SnapsToDevicePixels="True">
  63. <Grid Margin="{TemplateBinding Padding}">
  64. <TextBlock
  65. x:Name="placeholder"
  66. Padding="{TemplateBinding Padding}"
  67. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  68. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  69. FontSize="{TemplateBinding FontSize}"
  70. Foreground="{TemplateBinding PlaceholderForeground}"
  71. Text="{TemplateBinding PlaceholderText}"
  72. Visibility="Collapsed" />
  73. <Grid VerticalAlignment="Center">
  74. <Grid.ColumnDefinitions>
  75. <ColumnDefinition Width="*" />
  76. <ColumnDefinition Width="auto" />
  77. </Grid.ColumnDefinitions>
  78. <ScrollViewer
  79. x:Name="PART_ContentHost"
  80. Margin="0"
  81. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  82. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  83. Focusable="false"
  84. Foreground="{TemplateBinding Foreground}"
  85. HorizontalScrollBarVisibility="Hidden"
  86. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  87. Style="{x:Null}"
  88. VerticalScrollBarVisibility="Hidden" />
  89. <Button
  90. Name="PART_BtnClear"
  91. Grid.Column="1"
  92. Width="16"
  93. Height="16"
  94. Margin="9,0"
  95. HorizontalAlignment="Right"
  96. VerticalAlignment="Center"
  97. Background="Transparent"
  98. BorderThickness="0"
  99. Style="{StaticResource NoColorBtn}"
  100. Visibility="Collapsed">
  101. <Path
  102. Data="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.5303 5.53038L9.06069 8L11.5303 10.4696L10.4697 11.5303L8.00002 9.06066L5.53033 11.5303L4.46967 10.4697L6.93936 8L4.46967 5.53033L5.53033 4.46967L8.00002 6.93934L10.4697 4.46971L11.5303 5.53038Z"
  103. Fill="#CED0D4"
  104. Stretch="Uniform" />
  105. </Button>
  106. </Grid>
  107. </Grid>
  108. </Border>
  109. <ControlTemplate.Triggers>
  110. <Trigger Property="IsEnabled" Value="false">
  111. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  112. </Trigger>
  113. <Trigger Property="Text" Value="{x:Null}">
  114. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  115. </Trigger>
  116. <Trigger Property="IsMouseOver" Value="True">
  117. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  118. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
  119. </Trigger>
  120. <Trigger Property="IsFocused" Value="True">
  121. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  122. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
  123. <Setter TargetName="border" Property="Effect" Value="{StaticResource shadow.blue-0-4}" />
  124. </Trigger>
  125. <MultiTrigger>
  126. <MultiTrigger.Conditions>
  127. <Condition Property="IsFocused" Value="True" />
  128. <Condition Property="IsError" Value="True" />
  129. </MultiTrigger.Conditions>
  130. <MultiTrigger.Setters>
  131. <Setter TargetName="border" Property="Effect" Value="{StaticResource shadow.error.s}" />
  132. </MultiTrigger.Setters>
  133. </MultiTrigger>
  134. <Trigger Property="IsError" Value="True">
  135. <Setter Property="BorderBrush" Value="{StaticResource color.sys.border.error}" />
  136. </Trigger>
  137. <Trigger Property="Text" Value="">
  138. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  139. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  140. </Trigger>
  141. <Trigger Property="ShowClose" Value="False">
  142. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  143. </Trigger>
  144. <MultiTrigger>
  145. <MultiTrigger.Conditions>
  146. <Condition Property="Text" Value="" />
  147. <Condition Property="IsMouseOver" Value="True" />
  148. </MultiTrigger.Conditions>
  149. <MultiTrigger.Setters>
  150. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  151. </MultiTrigger.Setters>
  152. </MultiTrigger>
  153. </ControlTemplate.Triggers>
  154. </ControlTemplate>
  155. </Setter.Value>
  156. </Setter>
  157. <Style.Triggers>
  158. <MultiTrigger>
  159. <MultiTrigger.Conditions>
  160. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
  161. <Condition Property="IsSelectionActive" Value="false" />
  162. </MultiTrigger.Conditions>
  163. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  164. </MultiTrigger>
  165. </Style.Triggers>
  166. </Style>
  167. <Style TargetType="{x:Type cus:MenuItemWithPath}">
  168. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  169. <Setter Property="Background" Value="Transparent" />
  170. <Setter Property="Height" Value="32" />
  171. <Setter Property="Margin" Value="8,0" />
  172. <Setter Property="Template">
  173. <Setter.Value>
  174. <ControlTemplate TargetType="{x:Type cus:MenuItemWithPath}">
  175. <Border
  176. x:Name="Border"
  177. Background="{TemplateBinding Background}"
  178. BorderBrush="{TemplateBinding BorderBrush}"
  179. BorderThickness="0"
  180. CornerRadius="7">
  181. <Grid>
  182. <Grid.ColumnDefinitions>
  183. <ColumnDefinition
  184. x:Name="ColIcon"
  185. Width="Auto"
  186. SharedSizeGroup="MenuItemIconColumnGroup" />
  187. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  188. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  189. <ColumnDefinition x:Name="ColNext" Width="auto" />
  190. </Grid.ColumnDefinitions>
  191. <Path
  192. x:Name="Icon"
  193. Grid.Column="0"
  194. Width="{TemplateBinding PathWidth}"
  195. Height="{TemplateBinding PathHeight}"
  196. Margin="5,0"
  197. Data="{TemplateBinding Path}"
  198. Fill="{TemplateBinding Foreground}" />
  199. <Grid
  200. x:Name="GlyphPanel"
  201. Grid.Column="0"
  202. Margin="5,0"
  203. VerticalAlignment="Center"
  204. Visibility="Collapsed">
  205. <Viewbox
  206. Width="18"
  207. Height="18"
  208. VerticalAlignment="Center"
  209. FlowDirection="LeftToRight">
  210. <Path Data="M422.36247 839.786465c-13.320377 13.421684-34.909068 13.421684-48.126091 0l-10.69355-10.800997 0 0-11.398608-11.502985-50.145074-50.544163c-0.097214-0.201591 0-0.500397-0.201591-0.604774L72.380494 533.085224c-13.320377-13.421684-13.320377-35.218106 0-48.535413l72.132854-72.842005c13.319353-13.408381 34.907021-13.408381 48.224328 0l205.814506 209.252815L831.363631 184.208419c13.218046-13.414521 34.806737-13.414521 48.124044 0l72.134901 72.842005c13.317307 13.408381 13.317307 35.113729 0 48.52211L422.36247 839.786465 422.36247 839.786465z" Fill="{TemplateBinding Foreground}" />
  211. </Viewbox>
  212. </Grid>
  213. <ContentPresenter
  214. x:Name="HeaderHost"
  215. Grid.Column="1"
  216. Margin="{TemplateBinding Padding}"
  217. VerticalAlignment="Center"
  218. ContentSource="Header"
  219. RecognizesAccessKey="True" />
  220. <ContentPresenter
  221. x:Name="IGTHost"
  222. Grid.Column="2"
  223. Margin="8,0"
  224. VerticalAlignment="Center"
  225. ContentSource="InputGestureText" />
  226. <Grid
  227. x:Name="ArrowPanel"
  228. Grid.Column="3"
  229. Margin="10,0"
  230. HorizontalAlignment="Right"
  231. VerticalAlignment="Center">
  232. <Path
  233. x:Name="ArrowPanelPath"
  234. HorizontalAlignment="Right"
  235. VerticalAlignment="Center"
  236. Data="M0,0 L0,8 L4,4 z"
  237. Fill="{TemplateBinding Foreground}" />
  238. </Grid>
  239. <Popup
  240. x:Name="SubMenuPopup"
  241. AllowsTransparency="True"
  242. Focusable="false"
  243. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  244. Placement="Right">
  245. <Border
  246. x:Name="SubMenuBorder"
  247. Padding="2,2,2,2"
  248. Background="#1D1D1D"
  249. BorderBrush="#999999"
  250. BorderThickness="0"
  251. CornerRadius="7">
  252. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  253. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  254. </Grid>
  255. </Border>
  256. </Popup>
  257. </Grid>
  258. </Border>
  259. <ControlTemplate.Triggers>
  260. <Trigger Property="Role" Value="TopLevelHeader">
  261. <Setter Property="Padding" Value="6,1" />
  262. <Setter Property="Background" Value="Transparent" />
  263. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  264. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  265. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  266. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  267. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  268. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  269. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  270. </Trigger>
  271. <Trigger Property="IsHighlighted" Value="true">
  272. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  273. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  274. </Trigger>
  275. <MultiTrigger>
  276. <MultiTrigger.Conditions>
  277. <Condition Property="IsHighlighted" Value="True" />
  278. <Condition Property="Role" Value="TopLevelHeader" />
  279. </MultiTrigger.Conditions>
  280. <MultiTrigger.Setters>
  281. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  282. </MultiTrigger.Setters>
  283. </MultiTrigger>
  284. <Trigger Property="Role" Value="TopLevelItem">
  285. <Setter Property="Padding" Value="6,1" />
  286. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  287. </Trigger>
  288. <Trigger Property="Role" Value="SubmenuHeader">
  289. <Setter Property="Padding" Value="5,2" />
  290. </Trigger>
  291. <Trigger Property="Path" Value="{x:Null}">
  292. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  293. </Trigger>
  294. <Trigger Property="Role" Value="SubmenuItem">
  295. <Setter Property="Padding" Value="5,2" />
  296. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  297. </Trigger>
  298. <Trigger Property="IsChecked" Value="true">
  299. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  300. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  301. </Trigger>
  302. <Trigger Property="IsEnabled" Value="false">
  303. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  304. </Trigger>
  305. </ControlTemplate.Triggers>
  306. </ControlTemplate>
  307. </Setter.Value>
  308. </Setter>
  309. </Style>
  310. </ResourceDictionary>