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