ThemesContent.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <UserControl
  2. x:Class="PDF_Office.Views.PropertyPanel.ViewModular.ThemesContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:ViewModular="clr-namespace:PDF_Office.ViewModels.PropertyPanel.ViewModular"
  6. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.ViewModular"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:prism="http://prismlibrary.com/"
  12. Name="ThemesContentName"
  13. d:DataContext="{d:DesignInstance Type=ViewModular:ThemesContentViewModel}"
  14. d:DesignHeight="248"
  15. d:DesignWidth="235"
  16. Loaded="UserControl_Loaded"
  17. mc:Ignorable="d">
  18. <UserControl.Resources>
  19. <ResourceDictionary>
  20. <ResourceDictionary.MergedDictionaries>
  21. <ResourceDictionary Source="pack://application:,,,/Styles/RadioButtonStyle.xaml" />
  22. <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
  23. <ResourceDictionary Source="pack://application:,,,/Styles/TextBoxStyle.xaml" />
  24. </ResourceDictionary.MergedDictionaries>
  25. <convert:ObjectConvert x:Key="ObjectConvert" />
  26. <!-- 虚线边框 -->
  27. <DrawingBrush
  28. x:Key="StaticborderBrush"
  29. TileMode="Tile"
  30. Viewport="0,0,8,8"
  31. ViewportUnits="Absolute">
  32. <DrawingBrush.Drawing>
  33. <DrawingGroup>
  34. <GeometryDrawing Brush="#FFA0A2AE">
  35. <GeometryDrawing.Geometry>
  36. <GeometryGroup>
  37. <RectangleGeometry Rect="0,0,50,50" />
  38. <RectangleGeometry Rect="50,50,50,50" />
  39. </GeometryGroup>
  40. </GeometryDrawing.Geometry>
  41. </GeometryDrawing>
  42. </DrawingGroup>
  43. </DrawingBrush.Drawing>
  44. </DrawingBrush>
  45. <DrawingBrush
  46. x:Key="OverborderBrush"
  47. TileMode="Tile"
  48. Viewport="0,0,8,8"
  49. ViewportUnits="Absolute">
  50. <DrawingBrush.Drawing>
  51. <DrawingGroup>
  52. <GeometryDrawing Brush="#477EDE">
  53. <GeometryDrawing.Geometry>
  54. <GeometryGroup>
  55. <RectangleGeometry Rect="0,0,50,50" />
  56. <RectangleGeometry Rect="50,50,50,50" />
  57. </GeometryGroup>
  58. </GeometryDrawing.Geometry>
  59. </GeometryDrawing>
  60. </DrawingGroup>
  61. </DrawingBrush.Drawing>
  62. </DrawingBrush>
  63. <ContextMenu x:Key="radioButtonRightMenu">
  64. <ContextMenu.ItemContainerStyle>
  65. <Style TargetType="MenuItem">
  66. <Setter Property="Padding" Value="-28,7,-80,7" />
  67. <Setter Property="VerticalContentAlignment" Value="Center" />
  68. </Style>
  69. </ContextMenu.ItemContainerStyle>
  70. <MenuItem Click="MenuItem_Click">
  71. <MenuItem.Header>
  72. <StackPanel Orientation="Horizontal">
  73. <Path Data="M11,1 L11,3 L14,3 L14,4 L13,4 L13,15 L3,15 L3,4 L2,4 L2,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M6,5 L6,13 L5,13 L5,5 L6,5 Z M8.5,5 L8.5,13 L7.5,13 L7.5,5 L8.5,5 Z M11,5 L11,13 L10,13 L10,5 L11,5 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z" Fill="{StaticResource MenuIco.fill}" />
  74. <TextBlock Margin="10,0,0,0" Text="删除" />
  75. </StackPanel>
  76. </MenuItem.Header>
  77. </MenuItem>
  78. </ContextMenu>
  79. <Style
  80. x:Key="CustomBtnStyle"
  81. BasedOn="{StaticResource TitleBarBtn}"
  82. TargetType="{x:Type Button}">
  83. <Setter Property="Background" Value="Transparent" />
  84. <Setter Property="BorderBrush" Value="Transparent" />
  85. <Setter Property="Width" Value="auto" />
  86. <Setter Property="Height" Value="40" />
  87. <Setter Property="Template">
  88. <Setter.Value>
  89. <ControlTemplate TargetType="{x:Type Button}">
  90. <Border
  91. x:Name="border"
  92. Background="{TemplateBinding Background}"
  93. BorderBrush="{StaticResource StaticborderBrush}"
  94. BorderThickness="{TemplateBinding BorderThickness}"
  95. SnapsToDevicePixels="true">
  96. <ContentPresenter
  97. x:Name="contentPresenter"
  98. Margin="{TemplateBinding Padding}"
  99. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  100. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  101. Focusable="False"
  102. RecognizesAccessKey="True"
  103. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  104. </Border>
  105. <ControlTemplate.Triggers>
  106. <Trigger Property="IsMouseOver" Value="true">
  107. <Setter TargetName="border" Property="Background" Value="Transparent" />
  108. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource OverborderBrush}" />
  109. </Trigger>
  110. <Trigger Property="IsPressed" Value="true">
  111. <Setter TargetName="border" Property="Background" Value="#C7D8F5" />
  112. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource OverborderBrush}" />
  113. </Trigger>
  114. <Trigger Property="IsEnabled" Value="false">
  115. <Setter TargetName="border" Property="Background" Value="Transparent" />
  116. <Setter TargetName="border" Property="BorderBrush" Value="#33000000" />
  117. <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="#FF999999" />
  118. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.4" />
  119. </Trigger>
  120. </ControlTemplate.Triggers>
  121. </ControlTemplate>
  122. </Setter.Value>
  123. </Setter>
  124. </Style>
  125. </ResourceDictionary>
  126. </UserControl.Resources>
  127. <WrapPanel Name="btnsPanel" Width="auto" Orientation="Horizontal">
  128. <RadioButton
  129. Name="RBtnLight"
  130. Margin="4,0,4,0"
  131. Click="RBtnDark_Click"
  132. GroupName="DrawMode"
  133. IsChecked="{Binding LightDrawMode}"
  134. Style="{StaticResource PageViewRadioBtn}">
  135. <StackPanel Margin="0,0,3,0">
  136. <Border
  137. Width="16"
  138. Height="16"
  139. Margin="0,0,0,8"
  140. BorderBrush="#E2E3E6"
  141. BorderThickness="1">
  142. <Rectangle
  143. Width="16"
  144. Height="16"
  145. Fill="White" />
  146. </Border>
  147. <TextBlock
  148. x:Name="LightText"
  149. Style="{StaticResource PagesView_txtContext}"
  150. Text="Light" />
  151. </StackPanel>
  152. </RadioButton>
  153. <RadioButton
  154. Name="RBtnSepia"
  155. Margin="4,0,4,0"
  156. Click="RBtnDark_Click"
  157. GroupName="DrawMode"
  158. IsChecked="{Binding SepiaDrawMode}"
  159. Style="{StaticResource PageViewRadioBtn}">
  160. <StackPanel Margin="0,0,3,0">
  161. <Border
  162. Width="16"
  163. Height="16"
  164. Margin="0,0,0,8"
  165. BorderBrush="#E2E3E6"
  166. BorderThickness="1">
  167. <Rectangle
  168. Width="16"
  169. Height="16"
  170. Fill="#FFEFB2" />
  171. </Border>
  172. <TextBlock
  173. x:Name="SepiaText"
  174. Style="{StaticResource PagesView_txtContext}"
  175. Text="Sepia" />
  176. </StackPanel>
  177. </RadioButton>
  178. <RadioButton
  179. Name="RBtnDark"
  180. Margin="4,0,4,0"
  181. Click="RBtnDark_Click"
  182. GroupName="DrawMode"
  183. IsChecked="{Binding DarkDrawMode}"
  184. Style="{StaticResource PageViewRadioBtn}">
  185. <StackPanel Margin="0,0,3,0">
  186. <Border
  187. Width="16"
  188. Height="16"
  189. Margin="0,0,0,8"
  190. BorderBrush="#E2E3E6"
  191. BorderThickness="1">
  192. <Rectangle
  193. Width="16"
  194. Height="16"
  195. Fill="Black" />
  196. </Border>
  197. <TextBlock
  198. x:Name="DarkText"
  199. Style="{StaticResource PagesView_txtContext}"
  200. Text="Dark" />
  201. </StackPanel>
  202. </RadioButton>
  203. <RadioButton
  204. Name="RBtnReseda"
  205. Margin="4,4,4,0"
  206. Click="RBtnDark_Click"
  207. GroupName="DrawMode"
  208. IsChecked="{Binding ResedaDrawMode}"
  209. Style="{StaticResource PageViewRadioBtn}">
  210. <StackPanel Margin="0,0,3,0">
  211. <Border
  212. Width="16"
  213. Height="16"
  214. Margin="0,0,0,8"
  215. BorderBrush="#E2E3E6"
  216. BorderThickness="1">
  217. <Rectangle
  218. Width="16"
  219. Height="16"
  220. Fill="#CBE9CE" />
  221. </Border>
  222. <TextBlock
  223. x:Name="ResedaText"
  224. Style="{StaticResource PagesView_txtContext}"
  225. Text="Reseda" />
  226. </StackPanel>
  227. </RadioButton>
  228. <RadioButton
  229. Name="RBtnThemes1"
  230. Margin="4,4,4,0"
  231. GroupName="DrawMode"
  232. Click="RBtnDark_Click"
  233. ContextMenu="{StaticResource radioButtonRightMenu}"
  234. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  235. Style="{StaticResource PageViewRadioBtn}"
  236. Visibility="Collapsed">
  237. <StackPanel Margin="0,0,3,0">
  238. <Border
  239. Width="16"
  240. Height="16"
  241. Margin="0,0,0,8"
  242. BorderBrush="#E2E3E6"
  243. BorderThickness="1">
  244. <Rectangle
  245. Width="16"
  246. Height="16"
  247. Fill="#CBE9CE" />
  248. </Border>
  249. <TextBlock
  250. x:Name="Theme1Text"
  251. Style="{StaticResource PagesView_txtContext}"
  252. Text="Theme1" />
  253. </StackPanel>
  254. </RadioButton>
  255. <RadioButton
  256. Name="RBtnThemes2"
  257. Margin="4,4,4,0"
  258. GroupName="DrawMode"
  259. Click="RBtnDark_Click"
  260. ContextMenu="{StaticResource radioButtonRightMenu}"
  261. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  262. Style="{StaticResource PageViewRadioBtn}"
  263. Visibility="Collapsed">
  264. <StackPanel Margin="0,0,3,0">
  265. <Border
  266. Width="16"
  267. Height="16"
  268. Margin="0,0,0,8"
  269. BorderBrush="#E2E3E6"
  270. BorderThickness="1">
  271. <Rectangle
  272. Width="16"
  273. Height="16"
  274. Fill="#CBE9CE" />
  275. </Border>
  276. <TextBlock
  277. x:Name="Theme2Text"
  278. Style="{StaticResource PagesView_txtContext}"
  279. Text="Theme2" />
  280. </StackPanel>
  281. </RadioButton>
  282. <RadioButton
  283. Name="RBtnThemes3"
  284. Margin="4,4,4,0"
  285. GroupName="DrawMode"
  286. Click="RBtnDark_Click"
  287. ContextMenu="{StaticResource radioButtonRightMenu}"
  288. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  289. Style="{StaticResource PageViewRadioBtn}"
  290. Visibility="Collapsed">
  291. <StackPanel Margin="0,0,3,0">
  292. <Border
  293. Width="16"
  294. Height="16"
  295. Margin="0,0,0,8"
  296. BorderBrush="#E2E3E6"
  297. BorderThickness="1">
  298. <Rectangle
  299. Width="16"
  300. Height="16"
  301. Fill="#CBE9CE" />
  302. </Border>
  303. <TextBlock
  304. x:Name="Theme3Text"
  305. Style="{StaticResource PagesView_txtContext}"
  306. Text="Theme3" />
  307. </StackPanel>
  308. </RadioButton>
  309. <RadioButton
  310. Name="RBtnThemes4"
  311. Margin="4,4,4,0"
  312. GroupName="DrawMode"
  313. Click="RBtnDark_Click"
  314. ContextMenu="{StaticResource radioButtonRightMenu}"
  315. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  316. Style="{StaticResource PageViewRadioBtn}"
  317. Visibility="Collapsed">
  318. <StackPanel Margin="0,0,3,0">
  319. <Border
  320. Width="16"
  321. Height="16"
  322. Margin="0,0,0,8"
  323. BorderBrush="#E2E3E6"
  324. BorderThickness="1">
  325. <Rectangle
  326. Width="16"
  327. Height="16"
  328. Fill="#CBE9CE" />
  329. </Border>
  330. <TextBlock
  331. x:Name="Theme4Text"
  332. Style="{StaticResource PagesView_txtContext}"
  333. Text="Theme4" />
  334. </StackPanel>
  335. </RadioButton>
  336. <Border
  337. Width="72"
  338. Height="80"
  339. Margin="4,4,4,0">
  340. <Button
  341. Name="RBtnCustom"
  342. Width="60"
  343. Height="60"
  344. BorderThickness="1"
  345. Click="RBtnCustom_Click"
  346. Style="{DynamicResource CustomBtnStyle}">
  347. <StackPanel>
  348. <Path
  349. Margin="0,0,0,8"
  350. HorizontalAlignment="Center"
  351. Data="M8.5,2.5 L8.5,7.5 L13.5,7.5 L13.5,8.5 L8.5,8.5 L8.5,13.5 L7.5,13.5 L7.5,8.5 L2.5,8.5 L2.5,7.5 L7.5,7.5 L7.5,2.5 L8.5,2.5 Z"
  352. Fill="{StaticResource MenuIco.fill}" />
  353. <TextBlock
  354. x:Name="CustomText"
  355. Style="{StaticResource PagesView_txtContext}"
  356. Text="Custom" />
  357. </StackPanel>
  358. </Button>
  359. </Border>
  360. </WrapPanel>
  361. <i:Interaction.Triggers>
  362. <i:EventTrigger EventName="Loaded">
  363. <prism:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=btnsPanel}" />
  364. </i:EventTrigger>
  365. <!--<i:EventTrigger EventName="MouseDown">
  366. <prism:InvokeCommandAction Command="{Binding MouseDownCommand}" CommandParameter="{Binding}" />
  367. </i:EventTrigger>-->
  368. </i:Interaction.Triggers>
  369. </UserControl>