Style.xaml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <ImageBrush x:Key="imgOK" Stretch="UniformToFill" ImageSource="/HistoryDLL;component/Data/HistoryWallPage/Thumb/ok_idle.png" />
  4. <ImageBrush x:Key="imgOKOver" Stretch="UniformToFill" ImageSource="/HistoryDLL;component/Data/HistoryWallPage/Thumb/ok_focus.png" />
  5. <ImageBrush x:Key="imgCancel" Stretch="UniformToFill" ImageSource="/HistoryDLL;component/Data/HistoryWallPage/Thumb/exit_idle.png" />
  6. <ImageBrush x:Key="imgCancelOver" Stretch="UniformToFill" ImageSource="/HistoryDLL;component/Data/HistoryWallPage/Thumb/exit_focus.png" />
  7. <ImageBrush x:Key="imgHome" Stretch="UniformToFill" ImageSource="/HistoryDLL;component/Data/HistoryWallPage/Thumb/home.png" />
  8. <ImageBrush x:Key="imgLanguageBk" Stretch="UniformToFill" ImageSource="/HistoryDLL;component/Data/HistoryWallPage/Thumb/language_bk.png" />
  9. <Style x:Key="okButton" TargetType="Button">
  10. <Setter Property="SnapsToDevicePixels" Value="true"/>
  11. <Setter Property="OverridesDefaultStyle" Value="true"/>
  12. <Setter Property="Control.Template">
  13. <Setter.Value>
  14. <ControlTemplate TargetType="Button">
  15. <Border x:Name="Border" CornerRadius="2" BorderThickness="0" Background="{StaticResource imgOK}" BorderBrush="Transparent">
  16. </Border>
  17. <ControlTemplate.Triggers>
  18. <Trigger Property="IsMouseOver" Value="true">
  19. <Setter TargetName="Border" Property="Background" Value="{StaticResource imgOKOver}" />
  20. </Trigger>
  21. <Trigger Property="IsPressed" Value="true">
  22. <Setter TargetName="Border" Property="Background" Value="{StaticResource imgOKOver}" />
  23. </Trigger>
  24. <Trigger Property="IsEnabled" Value="false">
  25. <Setter TargetName="Border" Property="Background" Value="{StaticResource imgOKOver}" />
  26. </Trigger>
  27. </ControlTemplate.Triggers>
  28. </ControlTemplate>
  29. </Setter.Value>
  30. </Setter>
  31. </Style>
  32. <Style x:Key="exitButton" TargetType="Button">
  33. <Setter Property="SnapsToDevicePixels" Value="true"/>
  34. <Setter Property="OverridesDefaultStyle" Value="true"/>
  35. <Setter Property="Control.Template">
  36. <Setter.Value>
  37. <ControlTemplate TargetType="Button">
  38. <Border x:Name="Border" CornerRadius="2" BorderThickness="0" Background="{StaticResource imgCancel}" BorderBrush="Transparent">
  39. </Border>
  40. <ControlTemplate.Triggers>
  41. <Trigger Property="IsMouseOver" Value="true">
  42. <Setter TargetName="Border" Property="Background" Value="{StaticResource imgCancelOver}" />
  43. </Trigger>
  44. <Trigger Property="IsPressed" Value="true">
  45. <Setter TargetName="Border" Property="Background" Value="{StaticResource imgCancelOver}" />
  46. </Trigger>
  47. <Trigger Property="IsEnabled" Value="false">
  48. <Setter TargetName="Border" Property="Background" Value="{StaticResource imgCancelOver}" />
  49. </Trigger>
  50. </ControlTemplate.Triggers>
  51. </ControlTemplate>
  52. </Setter.Value>
  53. </Setter>
  54. </Style>
  55. <Style x:Key="ScrollBarThumb"
  56. TargetType="{x:Type Thumb}">
  57. <Setter Property="OverridesDefaultStyle"
  58. Value="true"/>
  59. <Setter Property="IsTabStop"
  60. Value="false"/>
  61. <Setter Property="Template">
  62. <Setter.Value>
  63. <ControlTemplate TargetType="{x:Type Thumb}">
  64. <Grid>
  65. <Rectangle
  66. Fill="White"
  67. />
  68. </Grid>
  69. </ControlTemplate>
  70. </Setter.Value>
  71. </Setter>
  72. </Style>
  73. <Style x:Key="HorizontalScrollBarPageButton"
  74. TargetType="{x:Type RepeatButton}">
  75. <Setter Property="OverridesDefaultStyle"
  76. Value="true"/>
  77. <Setter Property="Background"
  78. Value="Transparent"/>
  79. <Setter Property="Focusable"
  80. Value="false"/>
  81. <Setter Property="IsTabStop"
  82. Value="false"/>
  83. <Setter Property="Opacity"
  84. Value="0"/>
  85. <Setter Property="Template">
  86. <Setter.Value>
  87. <ControlTemplate TargetType="{x:Type RepeatButton}">
  88. <Rectangle Fill="{TemplateBinding Background}"
  89. Width="{TemplateBinding Width}"
  90. Height="{TemplateBinding Height}"/>
  91. </ControlTemplate>
  92. </Setter.Value>
  93. </Setter>
  94. </Style>
  95. <Style x:Key="VerticalScrollBarPageButton"
  96. TargetType="{x:Type RepeatButton}">
  97. <Setter Property="OverridesDefaultStyle"
  98. Value="true"/>
  99. <Setter Property="Background"
  100. Value="Transparent"/>
  101. <Setter Property="Focusable"
  102. Value="false"/>
  103. <Setter Property="IsTabStop"
  104. Value="false"/>
  105. <Setter Property="Opacity"
  106. Value="0"/>
  107. <Setter Property="Template">
  108. <Setter.Value>
  109. <ControlTemplate TargetType="{x:Type RepeatButton}">
  110. <Rectangle Fill="{TemplateBinding Background}"
  111. Width="{TemplateBinding Width}"
  112. Height="{TemplateBinding Height}"/>
  113. </ControlTemplate>
  114. </Setter.Value>
  115. </Setter>
  116. </Style>
  117. <Style x:Key="for_scrollbar"
  118. TargetType="{x:Type ScrollBar}">
  119. <Setter Property="Stylus.IsPressAndHoldEnabled"
  120. Value="false"/>
  121. <Setter Property="Stylus.IsFlicksEnabled"
  122. Value="false"/>
  123. <Setter Property="Background"
  124. Value="Transparent"/>
  125. <Setter Property="Margin"
  126. Value="0,1,1,6"/>
  127. <Setter Property="Width"
  128. Value="5"/>
  129. <Setter Property="MinWidth"
  130. Value="5"/>
  131. <Setter Property="Opacity"
  132. Value="0"/>
  133. <Setter Property="Template">
  134. <Setter.Value>
  135. <ControlTemplate TargetType="{x:Type ScrollBar}">
  136. <Grid x:Name="Bg" SnapsToDevicePixels="true">
  137. <Track x:Name="PART_Track"
  138. IsEnabled="{TemplateBinding IsMouseOver}"
  139. IsDirectionReversed="true">
  140. <Track.DecreaseRepeatButton>
  141. <RepeatButton
  142. Style="{StaticResource VerticalScrollBarPageButton}"
  143. Command="{x:Static ScrollBar.PageUpCommand}"/>
  144. </Track.DecreaseRepeatButton>
  145. <Track.IncreaseRepeatButton>
  146. <RepeatButton
  147. Style="{StaticResource VerticalScrollBarPageButton}"
  148. Command="{x:Static ScrollBar.PageDownCommand}"/>
  149. </Track.IncreaseRepeatButton>
  150. <Track.Thumb>
  151. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  152. </Track.Thumb>
  153. </Track>
  154. </Grid>
  155. </ControlTemplate>
  156. </Setter.Value>
  157. </Setter>
  158. <Style.Triggers>
  159. <Trigger Property="Orientation"
  160. Value="Horizontal">
  161. <Setter Property="Background"
  162. Value="Transparent"/>
  163. <Setter Property="Margin"
  164. Value="1,0,6,1"/>
  165. <Setter Property="Height"
  166. Value="5"/>
  167. <Setter Property="MinHeight"
  168. Value="5"/>
  169. <Setter Property="Width"
  170. Value="Auto"/>
  171. <Setter Property="Opacity"
  172. Value="0"/>
  173. <Setter Property="Template">
  174. <Setter.Value>
  175. <ControlTemplate TargetType="{x:Type ScrollBar}">
  176. <Grid x:Name="Bg" SnapsToDevicePixels="true">
  177. <Track x:Name="PART_Track"
  178. IsEnabled="{TemplateBinding IsMouseOver}">
  179. <Track.DecreaseRepeatButton>
  180. <RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}"
  181. Command="{x:Static ScrollBar.PageLeftCommand}"/>
  182. </Track.DecreaseRepeatButton>
  183. <Track.IncreaseRepeatButton>
  184. <RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}"
  185. Command="{x:Static ScrollBar.PageRightCommand}"/>
  186. </Track.IncreaseRepeatButton>
  187. <Track.Thumb>
  188. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  189. </Track.Thumb>
  190. </Track>
  191. </Grid>
  192. </ControlTemplate>
  193. </Setter.Value>
  194. </Setter>
  195. </Trigger>
  196. </Style.Triggers>
  197. </Style>
  198. <!--<Style TargetType="{x:Type ScrollViewer}">
  199. <Setter Property="BorderBrush"
  200. Value="LightGray"/>
  201. <Setter Property="BorderThickness"
  202. Value="0"/>
  203. <Setter Property="HorizontalContentAlignment"
  204. Value="Left"/>
  205. <Setter Property="HorizontalScrollBarVisibility"
  206. Value="Auto"/>
  207. <Setter Property="VerticalContentAlignment"
  208. Value="Top"/>
  209. <Setter Property="VerticalScrollBarVisibility"
  210. Value="Auto"/>
  211. <Setter Property="Template">
  212. <Setter.Value>
  213. <ControlTemplate TargetType="{x:Type ScrollViewer}">
  214. <Border BorderBrush="{TemplateBinding BorderBrush}"
  215. BorderThickness="{TemplateBinding BorderThickness}"
  216. SnapsToDevicePixels="True">
  217. <Grid Background="{TemplateBinding Background}">
  218. <ScrollContentPresenter
  219. Cursor="{TemplateBinding Cursor}"
  220. Margin="{TemplateBinding Padding}"
  221. ContentTemplate="{TemplateBinding ContentTemplate}"/>
  222. <ScrollBar x:Name="PART_VerticalScrollBar"
  223. HorizontalAlignment="Right"
  224. Maximum="{TemplateBinding ScrollableHeight}"
  225. Orientation="Vertical"
  226. Style="{StaticResource for_scrollbar}"
  227. ViewportSize="{TemplateBinding ViewportHeight}"
  228. Value="{TemplateBinding VerticalOffset}"
  229. Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
  230. <ScrollBar x:Name="PART_HorizontalScrollBar"
  231. Maximum="{TemplateBinding ScrollableWidth}"
  232. Orientation="Horizontal"
  233. Style="{StaticResource for_scrollbar}"
  234. VerticalAlignment="Bottom"
  235. Value="{TemplateBinding HorizontalOffset}"
  236. ViewportSize="{TemplateBinding ViewportWidth}"
  237. Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
  238. </Grid>
  239. </Border>
  240. <ControlTemplate.Triggers>
  241. <EventTrigger RoutedEvent="ScrollChanged">
  242. <BeginStoryboard>
  243. <Storyboard>
  244. <DoubleAnimation
  245. Storyboard.TargetName="PART_VerticalScrollBar"
  246. Storyboard.TargetProperty="Opacity"
  247. To="1"
  248. Duration="0:0:0.5"/>
  249. <DoubleAnimation
  250. Storyboard.TargetName="PART_VerticalScrollBar"
  251. Storyboard.TargetProperty="Opacity"
  252. To="0"
  253. Duration="0:0:0.5"
  254. BeginTime="0:0:0.5"/>
  255. <DoubleAnimation
  256. Storyboard.TargetName="PART_HorizontalScrollBar"
  257. Storyboard.TargetProperty="Opacity"
  258. To="1"
  259. Duration="0:0:0.5"/>
  260. <DoubleAnimation
  261. Storyboard.TargetName="PART_HorizontalScrollBar"
  262. Storyboard.TargetProperty="Opacity"
  263. To="0"
  264. Duration="0:0:0.5"
  265. BeginTime="0:0:0.5"/>
  266. </Storyboard>
  267. </BeginStoryboard>
  268. </EventTrigger>
  269. <EventTrigger RoutedEvent="MouseEnter"
  270. SourceName="PART_VerticalScrollBar">
  271. <BeginStoryboard>
  272. <Storyboard>
  273. <DoubleAnimation
  274. Storyboard.TargetName="PART_VerticalScrollBar"
  275. Storyboard.TargetProperty="Opacity"
  276. To="1"
  277. Duration="0:0:0.5"/>
  278. </Storyboard>
  279. </BeginStoryboard>
  280. </EventTrigger>
  281. <EventTrigger RoutedEvent="MouseLeave"
  282. SourceName="PART_VerticalScrollBar">
  283. <BeginStoryboard>
  284. <Storyboard>
  285. <DoubleAnimation
  286. Storyboard.TargetName="PART_VerticalScrollBar"
  287. Storyboard.TargetProperty="Opacity"
  288. To="0"
  289. Duration="0:0:0.5"/>
  290. </Storyboard>
  291. </BeginStoryboard>
  292. </EventTrigger>
  293. <EventTrigger RoutedEvent="MouseEnter"
  294. SourceName="PART_HorizontalScrollBar">
  295. <BeginStoryboard>
  296. <Storyboard>
  297. <DoubleAnimation
  298. Storyboard.TargetName="PART_HorizontalScrollBar"
  299. Storyboard.TargetProperty="Opacity"
  300. To="1"
  301. Duration="0:0:0.5"/>
  302. </Storyboard>
  303. </BeginStoryboard>
  304. </EventTrigger>
  305. <EventTrigger RoutedEvent="MouseLeave"
  306. SourceName="PART_HorizontalScrollBar">
  307. <BeginStoryboard>
  308. <Storyboard>
  309. <DoubleAnimation
  310. Storyboard.TargetName="PART_HorizontalScrollBar"
  311. Storyboard.TargetProperty="Opacity"
  312. To="0"
  313. Duration="0:0:0.5"/>
  314. </Storyboard>
  315. </BeginStoryboard>
  316. </EventTrigger>
  317. </ControlTemplate.Triggers>
  318. </ControlTemplate>
  319. </Setter.Value>
  320. </Setter>
  321. </Style>-->
  322. <Style x:Key="homeSwitchBtn" TargetType="Button">
  323. <Setter Property="SnapsToDevicePixels" Value="true"/>
  324. <Setter Property="OverridesDefaultStyle" Value="true"/>
  325. <Setter Property="Control.Template">
  326. <Setter.Value>
  327. <ControlTemplate TargetType="Button">
  328. <Border x:Name="Border" CornerRadius="2" BorderThickness="0" Background="{StaticResource imgHome}" BorderBrush="Transparent" Opacity="0.8">
  329. </Border>
  330. <ControlTemplate.Triggers>
  331. <Trigger Property="IsPressed" Value="true">
  332. <Setter TargetName="Border" Property="Opacity" Value="1" />
  333. </Trigger>
  334. </ControlTemplate.Triggers>
  335. </ControlTemplate>
  336. </Setter.Value>
  337. </Setter>
  338. </Style>
  339. <Style x:Key="languageSwitchBtn" TargetType="Button">
  340. <Setter Property="SnapsToDevicePixels" Value="true"/>
  341. <Setter Property="OverridesDefaultStyle" Value="true"/>
  342. <Setter Property="Control.Template">
  343. <Setter.Value>
  344. <ControlTemplate TargetType="Button">
  345. <Border x:Name="Border" CornerRadius="2" BorderThickness="0" Background="{StaticResource imgLanguageBk}" BorderBrush="Transparent" Opacity="0.8">
  346. <TextBlock Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" Foreground="White"></TextBlock>
  347. </Border>
  348. <ControlTemplate.Triggers>
  349. <Trigger Property="IsPressed" Value="true">
  350. <Setter TargetName="Border" Property="Opacity" Value="1" />
  351. </Trigger>
  352. </ControlTemplate.Triggers>
  353. </ControlTemplate>
  354. </Setter.Value>
  355. </Setter>
  356. </Style>
  357. <Style TargetType="{x:Type Button}" x:Key="detailViewerCloseButton">
  358. <Setter Property="IsEnabled" Value="True"/>
  359. <Setter Property="Template">
  360. <Setter.Value>
  361. <ControlTemplate TargetType="{x:Type Button}">
  362. <Grid x:Name="uxRootGrid" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}"
  363. Stylus.IsPressAndHoldEnabled="False" FocusVisualStyle="{x:Null}" RenderTransformOrigin="0.5,0.5">
  364. <Grid.RenderTransform>
  365. <ScaleTransform />
  366. </Grid.RenderTransform>
  367. <TextBlock FontWeight="Bold" FontSize="18" Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}"
  368. HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
  369. </Grid>
  370. <ControlTemplate.Triggers>
  371. <EventTrigger RoutedEvent="Mouse.PreviewMouseDown">
  372. <BeginStoryboard>
  373. <Storyboard>
  374. <DoubleAnimation
  375. Duration="0:0:0.15"
  376. Storyboard.TargetName="uxRootGrid"
  377. Storyboard.TargetProperty="(RenderTransform).(ScaleTransform.ScaleX)"
  378. To="0.9"/>
  379. <DoubleAnimation
  380. Duration="0:0:0.15"
  381. Storyboard.TargetName="uxRootGrid"
  382. Storyboard.TargetProperty="(RenderTransform).(ScaleTransform.ScaleY)"
  383. To="0.9"/>
  384. </Storyboard>
  385. </BeginStoryboard>
  386. </EventTrigger>
  387. <EventTrigger RoutedEvent="Mouse.MouseLeave">
  388. <BeginStoryboard>
  389. <Storyboard>
  390. <DoubleAnimation
  391. Duration="0:0:0.15"
  392. Storyboard.TargetName="uxRootGrid"
  393. Storyboard.TargetProperty="(RenderTransform).(ScaleTransform.ScaleX)"
  394. To="1"/>
  395. <DoubleAnimation
  396. Duration="0:0:0.15"
  397. Storyboard.TargetName="uxRootGrid"
  398. Storyboard.TargetProperty="(RenderTransform).(ScaleTransform.ScaleY)"
  399. To="1"/>
  400. </Storyboard>
  401. </BeginStoryboard>
  402. </EventTrigger>
  403. </ControlTemplate.Triggers>
  404. </ControlTemplate>
  405. </Setter.Value>
  406. </Setter>
  407. </Style>
  408. <Style TargetType="{x:Type RadioButton}" x:Key="uxdetailViewerLanBtn">
  409. <Setter Property="Template">
  410. <Setter.Value>
  411. <ControlTemplate TargetType="{x:Type RadioButton}">
  412. <Grid x:Name="uxGd" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}">
  413. <TextBlock x:Name="uxMainTx" HorizontalAlignment="Center" VerticalAlignment="Center"
  414. Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}"></TextBlock>
  415. </Grid>
  416. <ControlTemplate.Triggers>
  417. <Trigger Property="IsChecked" Value="false">
  418. <Setter TargetName="uxMainTx" Property="Opacity" Value="0.7" />
  419. </Trigger>
  420. </ControlTemplate.Triggers>
  421. </ControlTemplate>
  422. </Setter.Value>
  423. </Setter>
  424. </Style>
  425. </ResourceDictionary>