PageRenderTime 50ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/V4/Quickstarts/BasicMVVM/BasicMVVMApp/Theme/Theme.xaml

#
XAML | 550 lines | 524 code | 16 blank | 10 comment | 0 complexity | 771cbbe61150b00caa43156735a85b24 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. <!-- Tooltip -->
  198. <Style TargetType="ToolTip">
  199. <Setter Property="Width" Value="250" />
  200. <Setter Property="Background" Value="#FFFF99" />
  201. <Setter Property="FontSize" Value="10" />
  202. <Setter Property="Foreground" Value="Black" />
  203. <Setter Property="BorderBrush" Value="#FFCC33" />
  204. <Setter Property="BorderThickness" Value="2" />
  205. </Style>
  206. <!-- Tooltip image -->
  207. <Style x:Name="ToolTipImageStyle" TargetType="Image">
  208. <Setter Property="Source" Value="../Images/info.png"></Setter>
  209. <Setter Property="Width" Value="15"></Setter>
  210. <Setter Property="Height" Value="15"></Setter>
  211. <Setter Property="Margin" Value="2,0,0,0"></Setter>
  212. </Style>
  213. <!-- Border -->
  214. <Style x:Name="BorderBrush" TargetType="Border">
  215. <Setter Property="BorderBrush" Value="#FF0F68A6" />
  216. <Setter Property="BorderThickness" Value="2" />
  217. </Style>
  218. <Style x:Name="HeaderedBorderStyle" TargetType="Border">
  219. <Setter Property="BorderBrush" Value="#FF234D69" />
  220. <Setter Property="BorderThickness" Value="2" />
  221. <Setter Property="CornerRadius" Value="5" />
  222. <Setter Property="Background" Value="#FFD3DDE2" />
  223. <Setter Property="Padding" Value="5" />
  224. </Style>
  225. <!-- CheckBox -->
  226. <Style TargetType="CheckBox">
  227. <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
  228. <Setter Property="Background" Value="#00000000" />
  229. <Setter Property="HorizontalContentAlignment" Value="Left" />
  230. <Setter Property="VerticalContentAlignment" Value="Center" />
  231. <Setter Property="Padding" Value="4,1,0,0" />
  232. <Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}" />
  233. <Setter Property="Template">
  234. <Setter.Value>
  235. <ControlTemplate TargetType="CheckBox">
  236. <Grid>
  237. <Grid.ColumnDefinitions>
  238. <ColumnDefinition Width="16" />
  239. <ColumnDefinition Width="*" />
  240. </Grid.ColumnDefinitions>
  241. <vsm:VisualStateManager.VisualStateGroups>
  242. <vsm:VisualStateGroup x:Name="CommonStates">
  243. <vsm:VisualState x:Name="Normal" />
  244. <vsm:VisualState x:Name="MouseOver">
  245. <Storyboard>
  246. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
  247. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  248. </DoubleAnimationUsingKeyFrames>
  249. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  250. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  251. </DoubleAnimationUsingKeyFrames>
  252. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
  253. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  254. </DoubleAnimationUsingKeyFrames>
  255. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  256. <SplineColorKeyFrame KeyTime="0" Value="#4B000000" />
  257. </ColorAnimationUsingKeyFrames>
  258. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
  259. <SplineDoubleKeyFrame KeyTime="0" Value=".1" />
  260. </DoubleAnimationUsingKeyFrames>
  261. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  262. <SplineColorKeyFrame KeyTime="0" Value="#4AFFFFFF" />
  263. </ColorAnimationUsingKeyFrames>
  264. </Storyboard>
  265. </vsm:VisualState>
  266. <vsm:VisualState x:Name="Pressed">
  267. <Storyboard>
  268. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
  269. <SplineDoubleKeyFrame KeyTime="0" Value="1" />
  270. </DoubleAnimationUsingKeyFrames>
  271. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  272. <SplineDoubleKeyFrame KeyTime="0" Value="0.6" />
  273. </DoubleAnimationUsingKeyFrames>
  274. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
  275. <SplineDoubleKeyFrame KeyTime="0" Value="0" />
  276. </DoubleAnimationUsingKeyFrames>
  277. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
  278. <SplineColorKeyFrame KeyTime="0" Value="#FF000000" />
  279. </ColorAnimationUsingKeyFrames>
  280. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  281. <SplineColorKeyFrame KeyTime="0" Value="#FFC8C8C8" />
  282. </ColorAnimationUsingKeyFrames>
  283. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  284. <SplineColorKeyFrame KeyTime="0" Value="#4BFFFFFF" />
  285. </ColorAnimationUsingKeyFrames>
  286. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
  287. <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
  288. </DoubleAnimationUsingKeyFrames>
  289. </Storyboard>
  290. </vsm:VisualState>
  291. <vsm:VisualState x:Name="Disabled">
  292. <Storyboard>
  293. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
  294. <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
  295. </DoubleAnimationUsingKeyFrames>
  296. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
  297. <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
  298. </DoubleAnimationUsingKeyFrames>
  299. <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
  300. <SplineDoubleKeyFrame KeyTime="0" Value="0.2" />
  301. </DoubleAnimationUsingKeyFrames>
  302. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
  303. <SplineColorKeyFrame KeyTime="0" Value="#FFB1B1B1" />
  304. </ColorAnimationUsingKeyFrames>
  305. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
  306. <SplineColorKeyFrame KeyTime="0" Value="#FFECECEC" />
  307. </ColorAnimationUsingKeyFrames>
  308. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
  309. <SplineColorKeyFrame KeyTime="0" Value="#FFECECEC" />
  310. </ColorAnimationUsingKeyFrames>
  311. </Storyboard>
  312. </vsm:VisualState>
  313. </vsm:VisualStateGroup>
  314. <vsm:VisualStateGroup x:Name="CheckStates">
  315. <vsm:VisualState x:Name="Checked">
  316. <Storyboard>
  317. <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Visibility)">
  318. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
  319. </ObjectAnimationUsingKeyFrames>
  320. </Storyboard>
  321. </vsm:VisualState>
  322. <vsm:VisualState x:Name="Unchecked" />
  323. <vsm:VisualState x:Name="Indeterminate">
  324. <Storyboard>
  325. <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="IndeterminateRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
  326. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
  327. </ObjectAnimationUsingKeyFrames>
  328. </Storyboard>
  329. </vsm:VisualState>
  330. </vsm:VisualStateGroup>
  331. <vsm:VisualStateGroup x:Name="FocusStates">
  332. <vsm:VisualState x:Name="Focused">
  333. <Storyboard>
  334. <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
  335. <SplineColorKeyFrame KeyTime="0" Value="#BF000000" />
  336. </ColorAnimationUsingKeyFrames>
  337. </Storyboard>
  338. </vsm:VisualState>
  339. <vsm:VisualState x:Name="Unfocused" />
  340. </vsm:VisualStateGroup>
  341. <vsm:VisualStateGroup x:Name="ValidationStates">
  342. <vsm:VisualState x:Name="Valid"/>
  343. <vsm:VisualState x:Name="InvalidUnfocused">
  344. <Storyboard>
  345. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
  346. <DiscreteObjectKeyFrame KeyTime="0">
  347. <DiscreteObjectKeyFrame.Value>
  348. <Visibility>Visible</Visibility>
  349. </DiscreteObjectKeyFrame.Value>
  350. </DiscreteObjectKeyFrame>
  351. </ObjectAnimationUsingKeyFrames>
  352. </Storyboard>
  353. </vsm:VisualState>
  354. <vsm:VisualState x:Name="InvalidFocused">
  355. <Storyboard>
  356. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
  357. <DiscreteObjectKeyFrame KeyTime="0">
  358. <DiscreteObjectKeyFrame.Value>
  359. <Visibility>Visible</Visibility>
  360. </DiscreteObjectKeyFrame.Value>
  361. </DiscreteObjectKeyFrame>
  362. </ObjectAnimationUsingKeyFrames>
  363. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
  364. <DiscreteObjectKeyFrame KeyTime="0">
  365. <DiscreteObjectKeyFrame.Value>
  366. <system:Boolean>True</system:Boolean>
  367. </DiscreteObjectKeyFrame.Value>
  368. </DiscreteObjectKeyFrame>
  369. </ObjectAnimationUsingKeyFrames>
  370. </Storyboard>
  371. </vsm:VisualState>
  372. </vsm:VisualStateGroup>
  373. </vsm:VisualStateManager.VisualStateGroups>
  374. <Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="16" Height="16">
  375. <Grid.RowDefinitions>
  376. <RowDefinition Height="50*" />
  377. <RowDefinition Height="50*" />
  378. </Grid.RowDefinitions>
  379. <Border Grid.RowSpan="2" x:Name="White" BorderBrush="#FFB5B5B5" BorderThickness="1.2">
  380. <Border.Background>
  381. <RadialGradientBrush>
  382. <RadialGradientBrush.RelativeTransform>
  383. <TransformGroup>
  384. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.35" ScaleY="1.35" />
  385. </TransformGroup>
  386. </RadialGradientBrush.RelativeTransform>
  387. <GradientStop Color="#FFFFFFFF" Offset="0" />
  388. <GradientStop Color="#FFFFFFFF" Offset="1" />
  389. </RadialGradientBrush>
  390. </Border.Background>
  391. </Border>
  392. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1.2" x:Name="Background" Grid.RowSpan="2" Opacity=".5">
  393. <Border.Background>
  394. <LinearGradientBrush EndPoint="0.5,1.4" StartPoint="0.5,0">
  395. <GradientStop Color="{StaticResource PrimaryColor}" Offset="0.75" />
  396. <GradientStop Color="{StaticResource SecondaryColor}" Offset="1" />
  397. </LinearGradientBrush>
  398. </Border.Background>
  399. </Border>
  400. <Border Background="{TemplateBinding Background}" BorderBrush="#FFFFFFFF" BorderThickness=".75" x:Name="InnerBorder" Margin="1" Grid.RowSpan="2" Visibility="Visible" />
  401. <Border x:Name="Shadow" Margin="3" Grid.RowSpan="2">
  402. <Border.OpacityMask>
  403. <RadialGradientBrush>
  404. <RadialGradientBrush.RelativeTransform>
  405. <TransformGroup>
  406. <TranslateTransform X="0" Y="-0.5" />
  407. </TransformGroup>
  408. </RadialGradientBrush.RelativeTransform>
  409. <GradientStop Color="#00FFFFFF" Offset="0.3" />
  410. <GradientStop Color="#FFFFFFFF" Offset="1" />
  411. </RadialGradientBrush>
  412. </Border.OpacityMask>
  413. <Border.Background>
  414. <RadialGradientBrush>
  415. <RadialGradientBrush.RelativeTransform>
  416. <TransformGroup>
  417. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.75" ScaleY="2.25" />
  418. <TranslateTransform Y="0.65" />
  419. </TransformGroup>
  420. </RadialGradientBrush.RelativeTransform>
  421. <GradientStop Color="#00000000" Offset="0.55" />
  422. <GradientStop Color="#33000000" Offset="1" />
  423. </RadialGradientBrush>
  424. </Border.Background>
  425. </Border>
  426. <Border Margin="1,1,1,0" CornerRadius="0,0,7,7" x:Name="Highlight" Opacity="0.8" RenderTransformOrigin="0.5,1">
  427. <Border.Background>
  428. <RadialGradientBrush>
  429. <RadialGradientBrush.RelativeTransform>
  430. <TransformGroup>
  431. <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.25" ScaleY="2" />
  432. <TranslateTransform Y="-0.6" />
  433. </TransformGroup>
  434. </RadialGradientBrush.RelativeTransform>
  435. <GradientStop Color="#BFFFFFFF" Offset="0" />
  436. <GradientStop Color="#4CFFFFFF" Offset="1" />
  437. </RadialGradientBrush>
  438. </Border.Background>
  439. </Border>
  440. <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" />
  441. <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">
  442. <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" />
  443. </Grid>
  444. <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="7">
  445. <ToolTipService.ToolTip>
  446. <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
  447. <ToolTip.Triggers>
  448. <EventTrigger RoutedEvent="Canvas.Loaded">
  449. <BeginStoryboard>
  450. <Storyboard>
  451. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
  452. <DiscreteObjectKeyFrame KeyTime="0">
  453. <DiscreteObjectKeyFrame.Value>
  454. <system:Boolean>true</system:Boolean>
  455. </DiscreteObjectKeyFrame.Value>
  456. </DiscreteObjectKeyFrame>
  457. </ObjectAnimationUsingKeyFrames>
  458. </Storyboard>
  459. </BeginStoryboard>
  460. </EventTrigger>
  461. </ToolTip.Triggers>
  462. </ToolTip>
  463. </ToolTipService.ToolTip>
  464. <Grid Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Background="Transparent">
  465. <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"/>
  466. <Path Fill="#ffffff" Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
  467. </Grid>
  468. </Border>
  469. </Grid>
  470. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
  471. </Grid>
  472. </ControlTemplate>
  473. </Setter.Value>
  474. </Setter>
  475. </Style>
  476. <!--ValidationTooltipTemplate-->
  477. <ControlTemplate x:Key="ValidationToolTipTemplate">
  478. <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
  479. <vsm:VisualStateManager.VisualStateGroups>
  480. <vsm:VisualStateGroup x:Name="OpenStates">
  481. <vsm:VisualStateGroup.Transitions>
  482. <vsm:VisualTransition GeneratedDuration="0"/>
  483. <vsm:VisualTransition GeneratedDuration="0:0:0.2" To="Open">
  484. <Storyboard>
  485. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
  486. <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
  487. </DoubleAnimationUsingKeyFrames>
  488. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
  489. <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
  490. </DoubleAnimationUsingKeyFrames>
  491. </Storyboard>
  492. </vsm:VisualTransition>
  493. </vsm:VisualStateGroup.Transitions>
  494. <vsm:VisualState x:Name="Closed">
  495. <Storyboard>
  496. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
  497. <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
  498. </DoubleAnimationUsingKeyFrames>
  499. </Storyboard>
  500. </vsm:VisualState>
  501. <vsm:VisualState x:Name="Open">
  502. <Storyboard>
  503. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
  504. <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
  505. </DoubleAnimationUsingKeyFrames>
  506. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
  507. <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
  508. </DoubleAnimationUsingKeyFrames>
  509. </Storyboard>
  510. </vsm:VisualState>
  511. </vsm:VisualStateGroup>
  512. </vsm:VisualStateManager.VisualStateGroups>
  513. <Grid.RenderTransform>
  514. <TranslateTransform x:Name="xform" X="-25"/>
  515. </Grid.RenderTransform>
  516. <Border Margin="4,4,-4,-4" Background="#152A2E31" CornerRadius="4"/>
  517. <Border Margin="3,3,-3,-3" Background="#252A2E31" CornerRadius="4"/>
  518. <Border Margin="2,2,-2,-2" Background="#352A2E31" CornerRadius="4"/>
  519. <Border Margin="1,1,-1,-1" Background="#452A2E31" CornerRadius="4"/>
  520. <Border Background="#FFDC000C" CornerRadius="4"/>
  521. <Border CornerRadius="4">
  522. <Border.Background>
  523. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  524. <GradientStop Color="#66FFFFFF"/>
  525. <GradientStop Color="#66000000" Offset="1"/>
  526. <GradientStop Color="#00E5E5E5" Offset="0.1"/>
  527. <GradientStop Color="#00161616" Offset="0.9"/>
  528. </LinearGradientBrush>
  529. </Border.Background>
  530. <TextBlock Margin="8,3,8,4" MaxWidth="250" UseLayoutRounding="false" Foreground="White" Text="{Binding Path=(Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap"/>
  531. </Border>
  532. </Grid>
  533. </ControlTemplate>
  534. </ResourceDictionary>