PageRenderTime 57ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/V4/Quickstarts/MVVM/MVVM/Theme/Theme.xaml

#
XAML | 532 lines | 510 code | 14 blank | 8 comment | 0 complexity | 0f31bd6985a3665231646adb9f618110 MD5 | raw file
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  5. xmlns:system="clr-namespace:System;assembly=mscorlib">
  6. <!--Basic Brushes-->
  7. <Color x:Key="PrimaryColor">#FF63AADA</Color>
  8. <Color x:Key="SecondaryColor">#FFA0FCFF</Color>
  9. <SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource PrimaryColor}" />
  10. <SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource SecondaryColor}" />
  11. <SolidColorBrush x:Key="TextBrush" Color="#FF152937" />
  12. <SolidColorBrush x:Key="DisabledColor" Color="#8CFFFFFF" />
  13. <SolidColorBrush x:Key="BackgroundBrush" Color="#FFFFFFFF" />
  14. <LinearGradientBrush x:Key="MainBackground" EndPoint="0.5,1" StartPoint="0.5,0">
  15. <GradientStop Color="#FFCEDEFF" Offset="0"/>
  16. <GradientStop Color="#FF5A7CA0" Offset="0.992"/>
  17. <GradientStop Color="#FF5882A7" Offset="0.085"/>
  18. </LinearGradientBrush>
  19. <SolidColorBrush x:Key="WaitingAnimationColor" Color="DarkBlue"/>
  20. <!-- Button -->
  21. <Style TargetType="Button">
  22. <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
  23. <Setter Property="Background" Value="#00000000" />
  24. <Setter Property="Padding" Value="5,4" />
  25. <Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}" />
  26. <Setter Property="Template">
  27. <Setter.Value>
  28. <ControlTemplate TargetType="Button">
  29. <Grid x:Name="Button_Normal">
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="50*" />
  32. <RowDefinition Height="50*" />
  33. </Grid.RowDefinitions>
  34. <vsm:VisualStateManager.VisualStateGroups>
  35. <vsm:VisualStateGroup x:Name="FocusStates">
  36. <vsm:VisualState x:Name="Unfocused" />
  37. <vsm:VisualState x:Name="Focused">
  38. <Storyboard>
  39. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
  40. <SplineColorKeyFrame KeyTime="0" Value="#BF000000" />
  41. </ColorAnimationUsingKeyFrames>
  42. </Storyboard>
  43. </vsm:VisualState>
  44. </vsm:VisualStateGroup>
  45. <vsm:VisualStateGroup x:Name="CommonStates">
  46. <vsm:VisualStateGroup.Transitions>
  47. <vsm:VisualTransition GeneratedDuration="00:00:00.3" />
  48. <vsm:VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" />
  49. <vsm:VisualTransition From="MouseOver" GeneratedDuration="00:00:00.1" To="Normal" />
  50. </vsm:VisualStateGroup.Transitions>
  51. <vsm:VisualState x:Name="MouseOver">
  52. <Storyboard>
  53. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  54. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  55. </DoubleAnimationUsingKeyFrames>
  56. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
  57. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  58. </DoubleAnimationUsingKeyFrames>
  59. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  60. <SplineColorKeyFrame KeyTime="0" Value="#4B000000" />
  61. </ColorAnimationUsingKeyFrames>
  62. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
  63. <SplineDoubleKeyFrame KeyTime="0" Value=".1" />
  64. </DoubleAnimationUsingKeyFrames>
  65. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  66. <SplineColorKeyFrame KeyTime="0" Value="#4AFFFFFF" />
  67. </ColorAnimationUsingKeyFrames>
  68. </Storyboard>
  69. </vsm:VisualState>
  70. <vsm:VisualState x:Name="Normal" />
  71. <vsm:VisualState x:Name="Pressed">
  72. <Storyboard>
  73. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  74. <SplineDoubleKeyFrame KeyTime="0" Value="0.6" />
  75. </DoubleAnimationUsingKeyFrames>
  76. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
  77. <SplineDoubleKeyFrame KeyTime="0" Value="0" />
  78. </DoubleAnimationUsingKeyFrames>
  79. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
  80. <SplineColorKeyFrame KeyTime="0" Value="#FF000000" />
  81. </ColorAnimationUsingKeyFrames>
  82. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  83. <SplineColorKeyFrame KeyTime="0" Value="#FFC8C8C8" />
  84. </ColorAnimationUsingKeyFrames>
  85. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  86. <SplineColorKeyFrame KeyTime="0" Value="#4BFFFFFF" />
  87. </ColorAnimationUsingKeyFrames>
  88. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
  89. <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
  90. </DoubleAnimationUsingKeyFrames>
  91. </Storyboard>
  92. </vsm:VisualState>
  93. <vsm:VisualState x:Name="Disabled">
  94. <Storyboard>
  95. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
  96. <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
  97. </DoubleAnimationUsingKeyFrames>
  98. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  99. <SplineDoubleKeyFrame KeyTime="0" Value="0.2" />
  100. </DoubleAnimationUsingKeyFrames>
  101. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
  102. <SplineColorKeyFrame KeyTime="0" Value="#FFB1B1B1" />
  103. </ColorAnimationUsingKeyFrames>
  104. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
  105. <SplineColorKeyFrame KeyTime="0" Value="#FFECECEC" />
  106. </ColorAnimationUsingKeyFrames>
  107. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  108. <SplineColorKeyFrame KeyTime="0" Value="#FFECECEC" />
  109. </ColorAnimationUsingKeyFrames>
  110. </Storyboard>
  111. </vsm:VisualState>
  112. </vsm:VisualStateGroup>
  113. </vsm:VisualStateManager.VisualStateGroups>
  114. <Border CornerRadius="4" Grid.RowSpan="2" x:Name="White" BorderBrush="#FFFFFFFF" BorderThickness="1.2">
  115. <Border.Background>
  116. <RadialGradientBrush>
  117. <RadialGradientBrush.RelativeTransform>
  118. <TransformGroup>
  119. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.35" ScaleY="1.35" />
  120. </TransformGroup>
  121. </RadialGradientBrush.RelativeTransform>
  122. <GradientStop Color="#FFFFFFFF" Offset="0" />
  123. <GradientStop Color="#FFFFFFFF" Offset="1" />
  124. </RadialGradientBrush>
  125. </Border.Background>
  126. </Border>
  127. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1.2" CornerRadius="4" x:Name="Background" Grid.RowSpan="2" Opacity="0.65">
  128. <Border.Background>
  129. <LinearGradientBrush EndPoint="0.5,1.4" StartPoint="0.5,0">
  130. <GradientStop Color="{StaticResource PrimaryColor}" Offset="0.75" />
  131. <GradientStop Color="{StaticResource SecondaryColor}" Offset="1" />
  132. </LinearGradientBrush>
  133. </Border.Background>
  134. </Border>
  135. <Border Background="{TemplateBinding Background}" BorderBrush="#7FFFFFFF" BorderThickness="1" CornerRadius="3.5" x:Name="InnerBorder" Margin="1" Grid.RowSpan="2" />
  136. <Border CornerRadius="3.5" x:Name="Shadow" Margin="2" Grid.RowSpan="2">
  137. <Border.OpacityMask>
  138. <RadialGradientBrush>
  139. <RadialGradientBrush.RelativeTransform>
  140. <TransformGroup>
  141. <TranslateTransform X="0" Y="-0.5" />
  142. </TransformGroup>
  143. </RadialGradientBrush.RelativeTransform>
  144. <GradientStop Color="#00FFFFFF" Offset="0.3" />
  145. <GradientStop Color="#FFFFFFFF" Offset="1" />
  146. </RadialGradientBrush>
  147. </Border.OpacityMask>
  148. <Border.Background>
  149. <RadialGradientBrush>
  150. <RadialGradientBrush.RelativeTransform>
  151. <TransformGroup>
  152. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.75" ScaleY="2.25" />
  153. <TranslateTransform Y="0.65" />
  154. </TransformGroup>
  155. </RadialGradientBrush.RelativeTransform>
  156. <GradientStop Color="#00000000" Offset="0.55" />
  157. <GradientStop Color="#33000000" Offset="1" />
  158. </RadialGradientBrush>
  159. </Border.Background>
  160. </Border>
  161. <Border Margin="1,1,1,0" CornerRadius="4,4,40,40" x:Name="Highlight" Opacity="0.8" RenderTransformOrigin="0.5,1">
  162. <Border.Background>
  163. <RadialGradientBrush>
  164. <RadialGradientBrush.RelativeTransform>
  165. <TransformGroup>
  166. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.25" ScaleY="2" />
  167. <TranslateTransform Y="-0.6" />
  168. </TransformGroup>
  169. </RadialGradientBrush.RelativeTransform>
  170. <GradientStop Color="#BFFFFFFF" Offset="0" />
  171. <GradientStop Color="#4CFFFFFF" Offset="1" />
  172. </RadialGradientBrush>
  173. </Border.Background>
  174. </Border>
  175. <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5" Grid.RowSpan="2" />
  176. </Grid>
  177. </ControlTemplate>
  178. </Setter.Value>
  179. </Setter>
  180. </Style>
  181. <!-- TextBlocks -->
  182. <Style x:Name="QuestionLabelStyle" TargetType="TextBlock" >
  183. <Setter Property="FontWeight" Value="Bold" />
  184. </Style>
  185. <!-- TextBoxes -->
  186. <Style TargetType="TextBox">
  187. <Setter Property="BorderBrush" Value="#FF0F68A6" />
  188. <Setter Property="BorderThickness" Value="2" />
  189. </Style>
  190. <!-- ScrollViewer-->
  191. <Style TargetType="ScrollViewer">
  192. <Setter Property="BorderBrush" Value="#FF0F68A6" />
  193. <Setter Property="BorderThickness" Value="2" />
  194. <Setter Property="Background" Value="White" />
  195. <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
  196. </Style>
  197. <!-- Border -->
  198. <Style x:Name="BorderBrush" TargetType="Border">
  199. <Setter Property="BorderBrush" Value="#FF0F68A6" />
  200. <Setter Property="BorderThickness" Value="2" />
  201. </Style>
  202. <Style x:Name="HeaderedBorderStyle" TargetType="Border">
  203. <Setter Property="BorderBrush" Value="#FF234D69" />
  204. <Setter Property="BorderThickness" Value="2" />
  205. <Setter Property="CornerRadius" Value="5" />
  206. <Setter Property="Background" Value="#FFD3DDE2" />
  207. <Setter Property="Padding" Value="5" />
  208. </Style>
  209. <!-- CheckBox -->
  210. <Style TargetType="CheckBox">
  211. <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
  212. <Setter Property="Background" Value="#00000000" />
  213. <Setter Property="HorizontalContentAlignment" Value="Left" />
  214. <Setter Property="VerticalContentAlignment" Value="Center" />
  215. <Setter Property="Padding" Value="4,1,0,0" />
  216. <Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}" />
  217. <Setter Property="Template">
  218. <Setter.Value>
  219. <ControlTemplate TargetType="CheckBox">
  220. <Grid>
  221. <Grid.ColumnDefinitions>
  222. <ColumnDefinition Width="16" />
  223. <ColumnDefinition Width="*" />
  224. </Grid.ColumnDefinitions>
  225. <vsm:VisualStateManager.VisualStateGroups>
  226. <vsm:VisualStateGroup x:Name="CommonStates">
  227. <vsm:VisualState x:Name="Normal" />
  228. <vsm:VisualState x:Name="MouseOver">
  229. <Storyboard>
  230. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
  231. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  232. </DoubleAnimationUsingKeyFrames>
  233. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  234. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  235. </DoubleAnimationUsingKeyFrames>
  236. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
  237. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  238. </DoubleAnimationUsingKeyFrames>
  239. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  240. <SplineColorKeyFrame KeyTime="0" Value="#4B000000" />
  241. </ColorAnimationUsingKeyFrames>
  242. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
  243. <SplineDoubleKeyFrame KeyTime="0" Value=".1" />
  244. </DoubleAnimationUsingKeyFrames>
  245. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  246. <SplineColorKeyFrame KeyTime="0" Value="#4AFFFFFF" />
  247. </ColorAnimationUsingKeyFrames>
  248. </Storyboard>
  249. </vsm:VisualState>
  250. <vsm:VisualState x:Name="Pressed">
  251. <Storyboard>
  252. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
  253. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  254. </DoubleAnimationUsingKeyFrames>
  255. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  256. <SplineDoubleKeyFrame KeyTime="0" Value="0.6" />
  257. </DoubleAnimationUsingKeyFrames>
  258. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
  259. <SplineDoubleKeyFrame KeyTime="0" Value="0" />
  260. </DoubleAnimationUsingKeyFrames>
  261. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
  262. <SplineColorKeyFrame KeyTime="0" Value="#FF000000" />
  263. </ColorAnimationUsingKeyFrames>
  264. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  265. <SplineColorKeyFrame KeyTime="0" Value="#FFC8C8C8" />
  266. </ColorAnimationUsingKeyFrames>
  267. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  268. <SplineColorKeyFrame KeyTime="0" Value="#4BFFFFFF" />
  269. </ColorAnimationUsingKeyFrames>
  270. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
  271. <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
  272. </DoubleAnimationUsingKeyFrames>
  273. </Storyboard>
  274. </vsm:VisualState>
  275. <vsm:VisualState x:Name="Disabled">
  276. <Storyboard>
  277. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
  278. <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
  279. </DoubleAnimationUsingKeyFrames>
  280. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
  281. <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
  282. </DoubleAnimationUsingKeyFrames>
  283. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  284. <SplineDoubleKeyFrame KeyTime="0" Value="0.2" />
  285. </DoubleAnimationUsingKeyFrames>
  286. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
  287. <SplineColorKeyFrame KeyTime="0" Value="#FFB1B1B1" />
  288. </ColorAnimationUsingKeyFrames>
  289. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
  290. <SplineColorKeyFrame KeyTime="0" Value="#FFECECEC" />
  291. </ColorAnimationUsingKeyFrames>
  292. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  293. <SplineColorKeyFrame KeyTime="0" Value="#FFECECEC" />
  294. </ColorAnimationUsingKeyFrames>
  295. </Storyboard>
  296. </vsm:VisualState>
  297. </vsm:VisualStateGroup>
  298. <vsm:VisualStateGroup x:Name="CheckStates">
  299. <vsm:VisualState x:Name="Checked">
  300. <Storyboard>
  301. <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Visibility)">
  302. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
  303. </ObjectAnimationUsingKeyFrames>
  304. </Storyboard>
  305. </vsm:VisualState>
  306. <vsm:VisualState x:Name="Unchecked" />
  307. <vsm:VisualState x:Name="Indeterminate">
  308. <Storyboard>
  309. <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="IndeterminateRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
  310. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
  311. </ObjectAnimationUsingKeyFrames>
  312. </Storyboard>
  313. </vsm:VisualState>
  314. </vsm:VisualStateGroup>
  315. <vsm:VisualStateGroup x:Name="FocusStates">
  316. <vsm:VisualState x:Name="Focused">
  317. <Storyboard>
  318. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
  319. <SplineColorKeyFrame KeyTime="0" Value="#BF000000" />
  320. </ColorAnimationUsingKeyFrames>
  321. </Storyboard>
  322. </vsm:VisualState>
  323. <vsm:VisualState x:Name="Unfocused" />
  324. </vsm:VisualStateGroup>
  325. <vsm:VisualStateGroup x:Name="ValidationStates">
  326. <vsm:VisualState x:Name="Valid"/>
  327. <vsm:VisualState x:Name="InvalidUnfocused">
  328. <Storyboard>
  329. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
  330. <DiscreteObjectKeyFrame KeyTime="0">
  331. <DiscreteObjectKeyFrame.Value>
  332. <Visibility>Visible</Visibility>
  333. </DiscreteObjectKeyFrame.Value>
  334. </DiscreteObjectKeyFrame>
  335. </ObjectAnimationUsingKeyFrames>
  336. </Storyboard>
  337. </vsm:VisualState>
  338. <vsm:VisualState x:Name="InvalidFocused">
  339. <Storyboard>
  340. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
  341. <DiscreteObjectKeyFrame KeyTime="0">
  342. <DiscreteObjectKeyFrame.Value>
  343. <Visibility>Visible</Visibility>
  344. </DiscreteObjectKeyFrame.Value>
  345. </DiscreteObjectKeyFrame>
  346. </ObjectAnimationUsingKeyFrames>
  347. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
  348. <DiscreteObjectKeyFrame KeyTime="0">
  349. <DiscreteObjectKeyFrame.Value>
  350. <system:Boolean>True</system:Boolean>
  351. </DiscreteObjectKeyFrame.Value>
  352. </DiscreteObjectKeyFrame>
  353. </ObjectAnimationUsingKeyFrames>
  354. </Storyboard>
  355. </vsm:VisualState>
  356. </vsm:VisualStateGroup>
  357. </vsm:VisualStateManager.VisualStateGroups>
  358. <Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="16" Height="16">
  359. <Grid.RowDefinitions>
  360. <RowDefinition Height="50*" />
  361. <RowDefinition Height="50*" />
  362. </Grid.RowDefinitions>
  363. <Border Grid.RowSpan="2" x:Name="White" BorderBrush="#FFB5B5B5" BorderThickness="1.2">
  364. <Border.Background>
  365. <RadialGradientBrush>
  366. <RadialGradientBrush.RelativeTransform>
  367. <TransformGroup>
  368. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.35" ScaleY="1.35" />
  369. </TransformGroup>
  370. </RadialGradientBrush.RelativeTransform>
  371. <GradientStop Color="#FFFFFFFF" Offset="0" />
  372. <GradientStop Color="#FFFFFFFF" Offset="1" />
  373. </RadialGradientBrush>
  374. </Border.Background>
  375. </Border>
  376. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1.2" x:Name="Background" Grid.RowSpan="2" Opacity=".5">
  377. <Border.Background>
  378. <LinearGradientBrush EndPoint="0.5,1.4" StartPoint="0.5,0">
  379. <GradientStop Color="{StaticResource PrimaryColor}" Offset="0.75" />
  380. <GradientStop Color="{StaticResource SecondaryColor}" Offset="1" />
  381. </LinearGradientBrush>
  382. </Border.Background>
  383. </Border>
  384. <Border Background="{TemplateBinding Background}" BorderBrush="#FFFFFFFF" BorderThickness=".75" x:Name="InnerBorder" Margin="1" Grid.RowSpan="2" Visibility="Visible" />
  385. <Border x:Name="Shadow" Margin="3" Grid.RowSpan="2">
  386. <Border.OpacityMask>
  387. <RadialGradientBrush>
  388. <RadialGradientBrush.RelativeTransform>
  389. <TransformGroup>
  390. <TranslateTransform X="0" Y="-0.5" />
  391. </TransformGroup>
  392. </RadialGradientBrush.RelativeTransform>
  393. <GradientStop Color="#00FFFFFF" Offset="0.3" />
  394. <GradientStop Color="#FFFFFFFF" Offset="1" />
  395. </RadialGradientBrush>
  396. </Border.OpacityMask>
  397. <Border.Background>
  398. <RadialGradientBrush>
  399. <RadialGradientBrush.RelativeTransform>
  400. <TransformGroup>
  401. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.75" ScaleY="2.25" />
  402. <TranslateTransform Y="0.65" />
  403. </TransformGroup>
  404. </RadialGradientBrush.RelativeTransform>
  405. <GradientStop Color="#00000000" Offset="0.55" />
  406. <GradientStop Color="#33000000" Offset="1" />
  407. </RadialGradientBrush>
  408. </Border.Background>
  409. </Border>
  410. <Border Margin="1,1,1,0" CornerRadius="0,0,7,7" x:Name="Highlight" Opacity="0.8" RenderTransformOrigin="0.5,1">
  411. <Border.Background>
  412. <RadialGradientBrush>
  413. <RadialGradientBrush.RelativeTransform>
  414. <TransformGroup>
  415. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.25" ScaleY="2" />
  416. <TranslateTransform Y="-0.6" />
  417. </TransformGroup>
  418. </RadialGradientBrush.RelativeTransform>
  419. <GradientStop Color="#BFFFFFFF" Offset="0" />
  420. <GradientStop Color="#4CFFFFFF" Offset="1" />
  421. </RadialGradientBrush>
  422. </Border.Background>
  423. </Border>
  424. <Rectangle Stroke="{x:Null}" StrokeThickness="0" x:Name="IndeterminateRectangle" Fill="{StaticResource TextBrush}" Visibility="Collapsed" Height="3" Margin="4,4,4,4" Grid.RowSpan="2" RadiusX="1" RadiusY="1" />
  425. <Grid Opacity="0.8" Visibility="Collapsed" x:Name="Bullet" Margin="-0.25,-0.25,0,0" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.RowSpan="2">
  426. <Path Fill="{TemplateBinding Foreground}" Data="M1.6045539,4.9657478 L3.9166667,6.7270508 L8.7999792,0.13644244 L10.335848,1.2280303 L4.1581869,9.0391064 L0.39386681,6.6038928 z" Margin="1,-1,-1,0" Stretch="Fill" StrokeLineJoin="Miter" StrokeMiterLimit="10" VerticalAlignment="Stretch" />
  427. </Grid>
  428. <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="7">
  429. <ToolTipService.ToolTip>
  430. <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
  431. <ToolTip.Triggers>
  432. <EventTrigger RoutedEvent="Canvas.Loaded">
  433. <BeginStoryboard>
  434. <Storyboard>
  435. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
  436. <DiscreteObjectKeyFrame KeyTime="0">
  437. <DiscreteObjectKeyFrame.Value>
  438. <system:Boolean>true</system:Boolean>
  439. </DiscreteObjectKeyFrame.Value>
  440. </DiscreteObjectKeyFrame>
  441. </ObjectAnimationUsingKeyFrames>
  442. </Storyboard>
  443. </BeginStoryboard>
  444. </EventTrigger>
  445. </ToolTip.Triggers>
  446. </ToolTip>
  447. </ToolTipService.ToolTip>
  448. <Grid Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Background="Transparent">
  449. <Path Fill="#FFDC000C" Margin="1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
  450. <Path Fill="#ffffff" Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
  451. </Grid>
  452. </Border>
  453. </Grid>
  454. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
  455. </Grid>
  456. </ControlTemplate>
  457. </Setter.Value>
  458. </Setter>
  459. </Style>
  460. <!--ValidationTooltipTemplate-->
  461. <ControlTemplate x:Key="ValidationToolTipTemplate">
  462. <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
  463. <vsm:VisualStateManager.VisualStateGroups>
  464. <vsm:VisualStateGroup x:Name="OpenStates">
  465. <vsm:VisualStateGroup.Transitions>
  466. <vsm:VisualTransition GeneratedDuration="0"/>
  467. <vsm:VisualTransition GeneratedDuration="0:0:0.2" To="Open">
  468. <Storyboard>
  469. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
  470. <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
  471. </DoubleAnimationUsingKeyFrames>
  472. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
  473. <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
  474. </DoubleAnimationUsingKeyFrames>
  475. </Storyboard>
  476. </vsm:VisualTransition>
  477. </vsm:VisualStateGroup.Transitions>
  478. <vsm:VisualState x:Name="Closed">
  479. <Storyboard>
  480. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
  481. <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
  482. </DoubleAnimationUsingKeyFrames>
  483. </Storyboard>
  484. </vsm:VisualState>
  485. <vsm:VisualState x:Name="Open">
  486. <Storyboard>
  487. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
  488. <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
  489. </DoubleAnimationUsingKeyFrames>
  490. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
  491. <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
  492. </DoubleAnimationUsingKeyFrames>
  493. </Storyboard>
  494. </vsm:VisualState>
  495. </vsm:VisualStateGroup>
  496. </vsm:VisualStateManager.VisualStateGroups>
  497. <Grid.RenderTransform>
  498. <TranslateTransform x:Name="xform" X="-25"/>
  499. </Grid.RenderTransform>
  500. <Border Margin="4,4,-4,-4" Background="#152A2E31" CornerRadius="4"/>
  501. <Border Margin="3,3,-3,-3" Background="#252A2E31" CornerRadius="4"/>
  502. <Border Margin="2,2,-2,-2" Background="#352A2E31" CornerRadius="4"/>
  503. <Border Margin="1,1,-1,-1" Background="#452A2E31" CornerRadius="4"/>
  504. <Border Background="#FFDC000C" CornerRadius="4"/>
  505. <Border CornerRadius="4">
  506. <Border.Background>
  507. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  508. <GradientStop Color="#66FFFFFF"/>
  509. <GradientStop Color="#66000000" Offset="1"/>
  510. <GradientStop Color="#00E5E5E5" Offset="0.1"/>
  511. <GradientStop Color="#00161616" Offset="0.9"/>
  512. </LinearGradientBrush>
  513. </Border.Background>
  514. <TextBlock Margin="8,3,8,4" MaxWidth="250" UseLayoutRounding="false" Foreground="White" Text="{Binding Path=(Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap"/>
  515. </Border>
  516. </Grid>
  517. </ControlTemplate>
  518. </ResourceDictionary>