ThemesContent.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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">
  128. <RadioButton
  129. Name="RBtnLight"
  130. Margin="4,0,4,0"
  131. Command="{Binding SetDrawModeCommand}"
  132. CommandParameter="{Binding ElementName=RBtnLight}"
  133. GroupName="DrawMode"
  134. IsChecked="{Binding LightDrawMode}"
  135. Style="{StaticResource PageViewRadioBtn}">
  136. <StackPanel Margin="0,0,3,0">
  137. <Border
  138. Width="16"
  139. Height="16"
  140. Margin="0,0,0,8"
  141. BorderBrush="#E2E3E6"
  142. BorderThickness="1">
  143. <Rectangle
  144. Width="16"
  145. Height="16"
  146. Fill="White" />
  147. </Border>
  148. <TextBlock
  149. x:Name="LightText"
  150. Style="{StaticResource PagesView_txtContext}"
  151. Text="Light" />
  152. </StackPanel>
  153. </RadioButton>
  154. <RadioButton
  155. Name="RBtnSepia"
  156. Margin="4,0,4,0"
  157. Command="{Binding SetDrawModeCommand}"
  158. CommandParameter="{Binding ElementName=RBtnSepia}"
  159. GroupName="DrawMode"
  160. IsChecked="{Binding SepiaDrawMode}"
  161. Style="{StaticResource PageViewRadioBtn}">
  162. <StackPanel Margin="0,0,3,0">
  163. <Border
  164. Width="16"
  165. Height="16"
  166. Margin="0,0,0,8"
  167. BorderBrush="#E2E3E6"
  168. BorderThickness="1">
  169. <Rectangle
  170. Width="16"
  171. Height="16"
  172. Fill="#FFEFB2" />
  173. </Border>
  174. <TextBlock
  175. x:Name="SepiaText"
  176. Style="{StaticResource PagesView_txtContext}"
  177. Text="Sepia" />
  178. </StackPanel>
  179. </RadioButton>
  180. <RadioButton
  181. Name="RBtnDark"
  182. Margin="4,0,4,0"
  183. Command="{Binding SetDrawModeCommand}"
  184. CommandParameter="{Binding ElementName=RBtnDark}"
  185. GroupName="DrawMode"
  186. IsChecked="{Binding DarkDrawMode}"
  187. Style="{StaticResource PageViewRadioBtn}">
  188. <StackPanel Margin="0,0,3,0">
  189. <Border
  190. Width="16"
  191. Height="16"
  192. Margin="0,0,0,8"
  193. BorderBrush="#E2E3E6"
  194. BorderThickness="1">
  195. <Rectangle
  196. Width="16"
  197. Height="16"
  198. Fill="Black" />
  199. </Border>
  200. <TextBlock
  201. x:Name="DarkText"
  202. Style="{StaticResource PagesView_txtContext}"
  203. Text="Dark" />
  204. </StackPanel>
  205. </RadioButton>
  206. <RadioButton
  207. Name="RBtnReseda"
  208. Margin="4,4,4,0"
  209. Command="{Binding SetDrawModeCommand}"
  210. CommandParameter="{Binding ElementName=RBtnReseda}"
  211. GroupName="DrawMode"
  212. IsChecked="{Binding ResedaDrawMode}"
  213. Style="{StaticResource PageViewRadioBtn}">
  214. <StackPanel Margin="0,0,3,0">
  215. <Border
  216. Width="16"
  217. Height="16"
  218. Margin="0,0,0,8"
  219. BorderBrush="#E2E3E6"
  220. BorderThickness="1">
  221. <Rectangle
  222. Width="16"
  223. Height="16"
  224. Fill="#CBE9CE" />
  225. </Border>
  226. <TextBlock
  227. x:Name="ResedaText"
  228. Style="{StaticResource PagesView_txtContext}"
  229. Text="Reseda" />
  230. </StackPanel>
  231. </RadioButton>
  232. <RadioButton
  233. Name="RBtnThemes1"
  234. Margin="4,4,4,0"
  235. GroupName="DrawMode"
  236. Command="{Binding SetDrawModeCommand}"
  237. CommandParameter="{Binding ElementName=RBtnThemes1}"
  238. ContextMenu="{StaticResource radioButtonRightMenu}"
  239. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  240. Style="{StaticResource PageViewRadioBtn}"
  241. Visibility="Collapsed">
  242. <StackPanel Margin="0,0,3,0">
  243. <Border
  244. Width="16"
  245. Height="16"
  246. Margin="0,0,0,8"
  247. BorderBrush="#E2E3E6"
  248. BorderThickness="1">
  249. <Rectangle
  250. Width="16"
  251. Height="16"
  252. Fill="#CBE9CE" />
  253. </Border>
  254. <TextBlock
  255. x:Name="Theme1Text"
  256. Style="{StaticResource PagesView_txtContext}"
  257. Text="Theme1" />
  258. </StackPanel>
  259. </RadioButton>
  260. <RadioButton
  261. Name="RBtnThemes2"
  262. Margin="4,4,4,0"
  263. GroupName="DrawMode"
  264. Command="{Binding SetDrawModeCommand}"
  265. CommandParameter="{Binding ElementName=RBtnThemes2}"
  266. ContextMenu="{StaticResource radioButtonRightMenu}"
  267. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  268. Style="{StaticResource PageViewRadioBtn}"
  269. Visibility="Collapsed">
  270. <StackPanel Margin="0,0,3,0">
  271. <Border
  272. Width="16"
  273. Height="16"
  274. Margin="0,0,0,8"
  275. BorderBrush="#E2E3E6"
  276. BorderThickness="1">
  277. <Rectangle
  278. Width="16"
  279. Height="16"
  280. Fill="#CBE9CE" />
  281. </Border>
  282. <TextBlock
  283. x:Name="Theme2Text"
  284. Style="{StaticResource PagesView_txtContext}"
  285. Text="Theme2" />
  286. </StackPanel>
  287. </RadioButton>
  288. <RadioButton
  289. Name="RBtnThemes3"
  290. Margin="4,4,4,0"
  291. GroupName="DrawMode"
  292. Command="{Binding SetDrawModeCommand}"
  293. CommandParameter="{Binding ElementName=RBtnThemes3}"
  294. ContextMenu="{StaticResource radioButtonRightMenu}"
  295. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  296. Style="{StaticResource PageViewRadioBtn}"
  297. Visibility="Collapsed">
  298. <StackPanel Margin="0,0,3,0">
  299. <Border
  300. Width="16"
  301. Height="16"
  302. Margin="0,0,0,8"
  303. BorderBrush="#E2E3E6"
  304. BorderThickness="1">
  305. <Rectangle
  306. Width="16"
  307. Height="16"
  308. Fill="#CBE9CE" />
  309. </Border>
  310. <TextBlock
  311. x:Name="Theme3Text"
  312. Style="{StaticResource PagesView_txtContext}"
  313. Text="Theme3" />
  314. </StackPanel>
  315. </RadioButton>
  316. <RadioButton
  317. Name="RBtnThemes4"
  318. Margin="4,4,4,0"
  319. GroupName="DrawMode"
  320. Command="{Binding SetDrawModeCommand}"
  321. CommandParameter="{Binding ElementName=RBtnThemes4}"
  322. ContextMenu="{StaticResource radioButtonRightMenu}"
  323. IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
  324. Style="{StaticResource PageViewRadioBtn}"
  325. Visibility="Collapsed">
  326. <StackPanel Margin="0,0,3,0">
  327. <Border
  328. Width="16"
  329. Height="16"
  330. Margin="0,0,0,8"
  331. BorderBrush="#E2E3E6"
  332. BorderThickness="1">
  333. <Rectangle
  334. Width="16"
  335. Height="16"
  336. Fill="#CBE9CE" />
  337. </Border>
  338. <TextBlock
  339. x:Name="Theme4Text"
  340. Style="{StaticResource PagesView_txtContext}"
  341. Text="Theme4" />
  342. </StackPanel>
  343. </RadioButton>
  344. <Border
  345. Width="72"
  346. Height="80"
  347. Margin="4,4,4,0">
  348. <Button
  349. Name="RBtnCustom"
  350. Width="60"
  351. Height="60"
  352. BorderThickness="1"
  353. Click="RBtnCustom_Click"
  354. Style="{DynamicResource CustomBtnStyle}">
  355. <StackPanel>
  356. <Path
  357. Margin="0,0,0,8"
  358. HorizontalAlignment="Center"
  359. 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"
  360. Fill="{StaticResource MenuIco.fill}" />
  361. <TextBlock
  362. x:Name="CustomText"
  363. Style="{StaticResource PagesView_txtContext}"
  364. Text="Custom" />
  365. </StackPanel>
  366. </Button>
  367. </Border>
  368. </WrapPanel>
  369. <i:Interaction.Triggers>
  370. <i:EventTrigger EventName="Loaded">
  371. <prism:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=btnsPanel}" />
  372. </i:EventTrigger>
  373. <!--<i:EventTrigger EventName="MouseDown">
  374. <prism:InvokeCommandAction Command="{Binding MouseDownCommand}" CommandParameter="{Binding}" />
  375. </i:EventTrigger>-->
  376. </i:Interaction.Triggers>
  377. </UserControl>