Generic.xaml 19 KB

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