Generic.xaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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. FontFamily="Segoe UI"
  22. FontSize="16"
  23. FontWeight="Bold"
  24. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  25. Text="{TemplateBinding Header}" />
  26. </Border>
  27. <ContentPresenter
  28. Grid.Row="1"
  29. Content="{TemplateBinding Content}"
  30. Focusable="False"
  31. RecognizesAccessKey="True"
  32. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  33. <Border Grid.Row="2">
  34. <ContentControl Content="{TemplateBinding BottmBar}" />
  35. </Border>
  36. </Grid>
  37. </Border>
  38. </ControlTemplate>
  39. </Setter.Value>
  40. </Setter>
  41. </Style>
  42. <Style TargetType="{x:Type cus:TextBoxEx}">
  43. <Setter Property="Background" Value="{StaticResource color.field.bg.def}" />
  44. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  45. <Setter Property="Foreground" Value="Black" />
  46. <Setter Property="VerticalContentAlignment" Value="Center" />
  47. <Setter Property="HorizontalContentAlignment" Value="Left" />
  48. <Setter Property="BorderThickness" Value="1" />
  49. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  50. <Setter Property="Height" Value="32" />
  51. <Setter Property="Padding" Value="3,0" />
  52. <Setter Property="CornerRadius" Value="4" />
  53. <Setter Property="Template">
  54. <Setter.Value>
  55. <ControlTemplate TargetType="{x:Type cus:TextBoxEx}">
  56. <Border
  57. x:Name="border"
  58. Width="{TemplateBinding Width}"
  59. Height="{TemplateBinding Height}"
  60. Background="{TemplateBinding Background}"
  61. BorderBrush="{TemplateBinding BorderBrush}"
  62. BorderThickness="{TemplateBinding BorderThickness}"
  63. CornerRadius="{TemplateBinding CornerRadius}"
  64. SnapsToDevicePixels="True">
  65. <Grid Margin="{TemplateBinding Padding}">
  66. <TextBlock
  67. x:Name="placeholder"
  68. Padding="{TemplateBinding Padding}"
  69. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  70. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  71. FontSize="{TemplateBinding FontSize}"
  72. Foreground="{TemplateBinding PlaceholderForeground}"
  73. Text="{TemplateBinding PlaceholderText}"
  74. Visibility="Collapsed" />
  75. <!-- <Grid VerticalAlignment="Center">-->
  76. <Grid >
  77. <Grid.ColumnDefinitions>
  78. <ColumnDefinition Width="*" />
  79. <ColumnDefinition Width="auto" />
  80. </Grid.ColumnDefinitions>
  81. <ScrollViewer
  82. x:Name="PART_ContentHost"
  83. Margin="0"
  84. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  85. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  86. Focusable="false"
  87. Foreground="{TemplateBinding Foreground}"
  88. HorizontalScrollBarVisibility="Hidden"
  89. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  90. Style="{x:Null}"
  91. VerticalScrollBarVisibility="Hidden" />
  92. <Button
  93. Name="PART_BtnClear"
  94. Grid.Column="1"
  95. Width="16"
  96. Height="16"
  97. Margin="9,0"
  98. HorizontalAlignment="Right"
  99. VerticalAlignment="Center"
  100. Background="Transparent"
  101. BorderThickness="0"
  102. Style="{StaticResource NoColorBtn}"
  103. Visibility="Collapsed">
  104. <Path
  105. 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"
  106. Fill="#CED0D4"
  107. Stretch="Uniform" />
  108. </Button>
  109. </Grid>
  110. </Grid>
  111. </Border>
  112. <ControlTemplate.Triggers>
  113. <Trigger Property="IsEnabled" Value="false">
  114. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  115. </Trigger>
  116. <Trigger Property="Text" Value="{x:Null}">
  117. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  118. </Trigger>
  119. <Trigger Property="IsMouseOver" Value="True">
  120. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  121. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
  122. </Trigger>
  123. <Trigger Property="IsFocused" Value="True">
  124. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  125. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
  126. <Setter TargetName="border" Property="Effect" Value="{StaticResource shadow.blue-0-4}" />
  127. </Trigger>
  128. <MultiTrigger>
  129. <MultiTrigger.Conditions>
  130. <Condition Property="IsFocused" Value="True" />
  131. <Condition Property="IsError" Value="True" />
  132. </MultiTrigger.Conditions>
  133. <MultiTrigger.Setters>
  134. <Setter TargetName="border" Property="Effect" Value="{StaticResource shadow.error.s}" />
  135. </MultiTrigger.Setters>
  136. </MultiTrigger>
  137. <Trigger Property="IsError" Value="True">
  138. <Setter Property="BorderBrush" Value="{StaticResource color.sys.border.error}" />
  139. </Trigger>
  140. <Trigger Property="Text" Value="">
  141. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  142. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  143. </Trigger>
  144. <Trigger Property="ShowClose" Value="False">
  145. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  146. </Trigger>
  147. <MultiTrigger>
  148. <MultiTrigger.Conditions>
  149. <Condition Property="Text" Value="" />
  150. <Condition Property="IsMouseOver" Value="True" />
  151. </MultiTrigger.Conditions>
  152. <MultiTrigger.Setters>
  153. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  154. </MultiTrigger.Setters>
  155. </MultiTrigger>
  156. </ControlTemplate.Triggers>
  157. </ControlTemplate>
  158. </Setter.Value>
  159. </Setter>
  160. <Style.Triggers>
  161. <MultiTrigger>
  162. <MultiTrigger.Conditions>
  163. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
  164. <Condition Property="IsSelectionActive" Value="false" />
  165. </MultiTrigger.Conditions>
  166. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  167. </MultiTrigger>
  168. </Style.Triggers>
  169. </Style>
  170. <Style TargetType="{x:Type cus:MenuItemWithPath}">
  171. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  172. <Setter Property="Background" Value="Transparent" />
  173. <Setter Property="Height" Value="32" />
  174. <Setter Property="Margin" Value="8,0" />
  175. <Setter Property="Template">
  176. <Setter.Value>
  177. <ControlTemplate TargetType="{x:Type cus:MenuItemWithPath}">
  178. <Border
  179. x:Name="Border"
  180. Background="{TemplateBinding Background}"
  181. BorderBrush="{TemplateBinding BorderBrush}"
  182. BorderThickness="0"
  183. CornerRadius="7">
  184. <Grid>
  185. <Grid.ColumnDefinitions>
  186. <ColumnDefinition
  187. x:Name="ColIcon"
  188. Width="Auto"
  189. SharedSizeGroup="MenuItemIconColumnGroup" />
  190. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  191. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  192. <ColumnDefinition x:Name="ColNext" Width="auto" />
  193. </Grid.ColumnDefinitions>
  194. <Path
  195. x:Name="Icon"
  196. Grid.Column="0"
  197. Width="{TemplateBinding PathWidth}"
  198. Height="{TemplateBinding PathHeight}"
  199. Margin="5,0"
  200. Data="{TemplateBinding Path}"
  201. Fill="{TemplateBinding Foreground}" />
  202. <Grid
  203. x:Name="GlyphPanel"
  204. Grid.Column="0"
  205. Margin="5,0"
  206. VerticalAlignment="Center"
  207. Visibility="Collapsed">
  208. <Viewbox
  209. Width="18"
  210. Height="18"
  211. VerticalAlignment="Center"
  212. FlowDirection="LeftToRight">
  213. <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}" />
  214. </Viewbox>
  215. </Grid>
  216. <ContentPresenter
  217. x:Name="HeaderHost"
  218. Grid.Column="1"
  219. Margin="{TemplateBinding Padding}"
  220. VerticalAlignment="Center"
  221. ContentSource="Header"
  222. RecognizesAccessKey="True" />
  223. <ContentPresenter
  224. x:Name="IGTHost"
  225. Grid.Column="2"
  226. Margin="8,0"
  227. VerticalAlignment="Center"
  228. ContentSource="InputGestureText" />
  229. <Grid
  230. x:Name="ArrowPanel"
  231. Grid.Column="3"
  232. Margin="10,0"
  233. HorizontalAlignment="Right"
  234. VerticalAlignment="Center">
  235. <Path
  236. x:Name="ArrowPanelPath"
  237. HorizontalAlignment="Right"
  238. VerticalAlignment="Center"
  239. Data="M0,0 L0,8 L4,4 z"
  240. Fill="{TemplateBinding Foreground}" />
  241. </Grid>
  242. <Popup
  243. x:Name="SubMenuPopup"
  244. AllowsTransparency="True"
  245. Focusable="false"
  246. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  247. Placement="Right">
  248. <Border
  249. x:Name="SubMenuBorder"
  250. Padding="2,2,2,2"
  251. Background="#1D1D1D"
  252. BorderBrush="#999999"
  253. BorderThickness="0"
  254. CornerRadius="7">
  255. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  256. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  257. </Grid>
  258. </Border>
  259. </Popup>
  260. </Grid>
  261. </Border>
  262. <ControlTemplate.Triggers>
  263. <Trigger Property="Role" Value="TopLevelHeader">
  264. <Setter Property="Padding" Value="6,1" />
  265. <Setter Property="Background" Value="Transparent" />
  266. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  267. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  268. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  269. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  270. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  271. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  272. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  273. </Trigger>
  274. <Trigger Property="IsHighlighted" Value="true">
  275. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  276. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  277. </Trigger>
  278. <MultiTrigger>
  279. <MultiTrigger.Conditions>
  280. <Condition Property="IsHighlighted" Value="True" />
  281. <Condition Property="Role" Value="TopLevelHeader" />
  282. </MultiTrigger.Conditions>
  283. <MultiTrigger.Setters>
  284. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  285. </MultiTrigger.Setters>
  286. </MultiTrigger>
  287. <Trigger Property="Role" Value="TopLevelItem">
  288. <Setter Property="Padding" Value="6,1" />
  289. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  290. </Trigger>
  291. <Trigger Property="Role" Value="SubmenuHeader">
  292. <Setter Property="Padding" Value="5,2" />
  293. </Trigger>
  294. <Trigger Property="Path" Value="{x:Null}">
  295. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  296. </Trigger>
  297. <Trigger Property="Role" Value="SubmenuItem">
  298. <Setter Property="Padding" Value="5,2" />
  299. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  300. </Trigger>
  301. <Trigger Property="IsChecked" Value="true">
  302. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  303. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  304. </Trigger>
  305. <Trigger Property="IsEnabled" Value="false">
  306. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  307. </Trigger>
  308. </ControlTemplate.Triggers>
  309. </ControlTemplate>
  310. </Setter.Value>
  311. </Setter>
  312. </Style>
  313. </ResourceDictionary>