comparison Chronosv2/source/Themes/Metro/WidgetStyles.xaml @ 10:443821e55f06

Initial cleaned up add from Codeplex files
author stevenh7776 stevenhollidge@hotmail.com
date Tue, 21 Feb 2012 17:25:44 +0700
parents
children
comparison
equal deleted inserted replaced
9:904a9faadf8b 10:443821e55f06
1 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3 xmlns:chronos="http://chronos/schemas/2010/xaml">
4
5 <!-- Global Settings-->
6 <ResourceDictionary.MergedDictionaries>
7 <ResourceDictionary Source="Colors.xaml"/>
8 <ResourceDictionary Source="Brushes.xaml"/>
9 <ResourceDictionary Source="Fonts.xaml"/>
10 <ResourceDictionary Source="CoreStyles.xaml"/>
11 </ResourceDictionary.MergedDictionaries>
12
13 <!--Widget Style-->
14 <Style x:Key="DefaultWidgetStyle" TargetType="{x:Type chronos:WidgetElement}">
15 <Setter Property="Id" Value="{Binding Id}"/>
16 <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
17 <Setter Property="Background" Value="{StaticResource GradientBackgroundBrush}" />
18 <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
19 <Setter Property="BorderThickness" Value="1" />
20 <Setter Property="FocusVisualStyle" Value="{x:Null}" />
21 <Setter Property="MinWidth" Value="100"/>
22 <Setter Property="MinHeight" Value="53"/>
23 <Setter Property="Width" Value="Auto" />
24 <Setter Property="Height" Value="Auto" />
25 <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
26 <Setter Property="VerticalContentAlignment" Value="Stretch"/>
27 <Setter Property="ConstraintToParent" Value="True" />
28 <Setter Property="AllowDrop" Value="False" />
29 <Setter Property="Template">
30 <Setter.Value>
31 <ControlTemplate TargetType="{x:Type chronos:WidgetElement}">
32 <Grid>
33 <Border x:Name="Chrome"
34 Grid.RowSpan="2"
35 Background="{TemplateBinding Background}"
36 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
37 BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
38 CornerRadius="5,0,5,0" />
39
40 <Grid Margin="3.5">
41 <Grid.RowDefinitions>
42 <RowDefinition Height="Auto" />
43 <RowDefinition Height="Auto" />
44 <RowDefinition Height="*" />
45 </Grid.RowDefinitions>
46
47 <Grid Grid.Row="0">
48
49 <Grid.ColumnDefinitions>
50 <ColumnDefinition x:Name="HeaderLeftPartColumn" Width="*" />
51 <ColumnDefinition x:Name="HeaderRightPartColumn" Width="65" />
52 </Grid.ColumnDefinitions>
53
54 <Rectangle x:Name="PART_Dragger"
55 Grid.ColumnSpan="2"
56 Margin="3.5"
57 Fill="Transparent" />
58
59 <Grid Grid.Column="0" Margin="3.5">
60 <Grid.RowDefinitions>
61 <RowDefinition Height="10" />
62 <RowDefinition Height="Auto" />
63 </Grid.RowDefinitions>
64
65 <Rectangle x:Name="GradientBrand" Grid.Row="0"
66 VerticalAlignment="Bottom" HorizontalAlignment="Left"
67 Fill="{StaticResource AccentColorBlueBrush}"
68 Width="109" Height="6"
69 IsHitTestVisible="False" />
70
71 <TextBlock Grid.Row="1"
72 FontFamily="{StaticResource HeaderFontFamily}" FontSize="{StaticResource HeaderFontSize}" FontWeight="SemiBold"
73 HorizontalAlignment="Left" VerticalAlignment="Center"
74 Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Title}"
75 IsHitTestVisible="False">
76 </TextBlock>
77 </Grid>
78
79 <StackPanel x:Name="HeaderRightPartContent"
80 Grid.Column="1"
81 Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right">
82
83 <Button x:Name="PART_MinimizeButton"
84 Style="{StaticResource MetroButtonStyle}"
85 Command="chronos:WidgetElement.MinimizeCommand"
86 VerticalAlignment="Center" Margin="1.5"
87 ToolTip="Minimize">
88 <TextBlock TextWrapping="Wrap" Text="0" FontFamily="Webdings" FontSize="13.333" FontWeight="Normal"/>
89 </Button>
90
91 <Button x:Name="PART_CloseButton"
92 Style="{StaticResource MetroButtonStyle}"
93 Command="{Binding CloseCommand}"
94 VerticalAlignment="Center" Margin="1.5"
95 ToolTip="Close">
96 <TextBlock TextWrapping="Wrap" Text="r" FontFamily="Webdings" FontSize="13.333" FontWeight="Normal"/>
97 </Button>
98 </StackPanel>
99 </Grid>
100
101 <Grid Grid.Row="2">
102 <ContentPresenter x:Name="PART_ContentPresenter"
103 Content="{TemplateBinding Content}"
104 ContentTemplate="{TemplateBinding ContentTemplate}"
105 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
106 VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
107 </Grid>
108 </Grid>
109 </Grid>
110
111 <ControlTemplate.Triggers>
112 <Trigger Property="IsActive" Value="False">
113 <Setter TargetName="GradientBrand" Property="Fill" Value="{StaticResource AccentColorGreenBrush}" />
114 </Trigger>
115
116 <Trigger Property="WidgetState" Value="Minimized">
117 <Setter TargetName="PART_ContentPresenter" Property="Visibility" Value="Collapsed" />
118 </Trigger>
119
120 <Trigger Property="WidgetState" Value="Normal">
121 <Setter TargetName="PART_ContentPresenter" Property="Visibility" Value="Visible" />
122 </Trigger>
123
124 <Trigger Property="ShowMinimizeButton" Value="False">
125 <Setter TargetName="PART_MinimizeButton" Property="Visibility" Value="Collapsed"/>
126 </Trigger>
127 </ControlTemplate.Triggers>
128 </ControlTemplate>
129 </Setter.Value>
130 </Setter>
131 </Style>
132
133 <!--Gadget Style-->
134 <Style x:Key="VisibleResizeGrip"
135 TargetType="{x:Type ResizeGrip}">
136 <Setter Property="Background"
137 Value="Transparent" />
138 <Setter Property="Margin"
139 Value="0,0,1,1" />
140 <Setter Property="Template">
141 <Setter.Value>
142 <ControlTemplate TargetType="{x:Type ResizeGrip}">
143 <Grid SnapsToDevicePixels="True"
144 Background="Transparent">
145 <Path Fill="{StaticResource GripperShadowBrush}"
146 HorizontalAlignment="Center"
147 VerticalAlignment="Center"
148 Data="
149 M 9,1 L 11,1 L 11,3 L 9,3 Z
150 M 5,5 L 7,5 L 7,7 L 5,7 Z
151 M 9,5 L 11,5 L 11,7 L 9,7 Z
152 M 1,9 L 3,9 L 3,11 L 1,11 Z
153 M 5,9 L 7,9 L 7,11 L 5,11 Z
154 M 5,1 L 7,1 L 7,3 L 5,3 Z
155 M 1,1 L 3,1 L 3,3 L 1,3 Z
156 M 1,5 L 3,5 L 3,7 L 1,7 Z
157 M 1,13 L 3,13 L 3,15 L 1,15 Z
158 M 5,13 L 7,13 L 7,15 L 5,15 Z
159 M 9,13 L 11,13 L 11,15 L 9,15 Z
160 M 9,9 L 11,9 L 11,11 L 9,11 Z" />
161 <Path Fill="{StaticResource GripperHighlightBrush}"
162 HorizontalAlignment="Center"
163 VerticalAlignment="Center"
164 Data="
165 M 8,0 L 10,0 L 10,2 L 8,2 Z
166 M 4,4 L 6,4 L 6,6 L 4,6 Z
167 M 8,4 L 10,4 L 10,6 L 8,6 Z
168 M 0,8 L 2,8 L 2,10 L 0,10 Z
169 M 4,8 L 6,8 L 6,10 L 4,10 Z
170 M 4,0 L 6,0 L 6,2 L 4,2 Z
171 M 0,0 L 2,0 L 2,2 L 0,2 Z
172 M 0,4 L 2,4 L 2,6 L 0,6 Z
173 M 0,12 L 2,12 L 2,14 L 0,14 Z
174 M 4,12 L 6,12 L 6,14 L 4,14 Z
175 M 8,12 L 10,12 L 10,14 L 8,14 Z
176 M 8,8 L 10,8 L 10,10 L 8,10 Z" />
177 </Grid>
178 </ControlTemplate>
179 </Setter.Value>
180 </Setter>
181 </Style>
182
183 <Style x:Key="DefaultGadgetStyle" TargetType="{x:Type chronos:WidgetElement}">
184 <Setter Property="Id" Value="{Binding Id}"/>
185 <Setter Property="FocusVisualStyle" Value="{x:Null}" />
186 <Setter Property="Width" Value="Auto" />
187 <Setter Property="Height" Value="Auto" />
188 <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
189 <Setter Property="VerticalContentAlignment" Value="Stretch"/>
190 <Setter Property="ConstraintToParent" Value="True" />
191 <Setter Property="CanResize" Value="False" />
192 <Setter Property="AllowDrop" Value="False" />
193 <Setter Property="ShowMinimizeButton" Value="False" />
194 <Setter Property="Template">
195 <Setter.Value>
196 <ControlTemplate TargetType="{x:Type chronos:WidgetElement}">
197 <Grid ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Title}">
198 <Grid.ColumnDefinitions>
199 <ColumnDefinition Width="*" />
200 <ColumnDefinition Width="21" />
201 </Grid.ColumnDefinitions>
202
203 <Border x:Name="Chrome"
204 Grid.Column="0" Grid.ColumnSpan="2"
205 Background="{StaticResource GadgetBackgroundBrush}"
206 CornerRadius="5"
207 Visibility="Collapsed" />
208
209 <Grid x:Name="SideBar"
210 Grid.Column="1"
211 HorizontalAlignment="Right" VerticalAlignment="Top">
212
213 <Grid.RowDefinitions>
214 <RowDefinition Height="3.5" />
215 <RowDefinition Height="18" />
216 <RowDefinition Height="3.5" />
217 <RowDefinition Height="22" />
218 <RowDefinition Height="3.5" />
219 </Grid.RowDefinitions>
220
221 <Border x:Name="ControlBarBorder"
222 Grid.Row="0" Grid.RowSpan="5"
223 Background="{StaticResource ControlBarBackgroundBrush}"
224 BorderBrush="{StaticResource ControlBarBorderBrush}" BorderThickness="1"
225 CornerRadius="3"
226 Padding="1"
227 Width="20" Height="63" />
228
229 <Button x:Name="PART_CloseButton"
230 Grid.Row="1"
231 Style="{StaticResource MetroButtonStyle}"
232 Command="{Binding CloseCommand}"
233 VerticalAlignment="Top"
234 Margin="1.5"
235 ToolTip="Close">
236 <TextBlock TextWrapping="Wrap" Text="r" FontFamily="Webdings" Foreground="{StaticResource WhiteBrush}" FontSize="11.333" FontWeight="Normal"/>
237 </Button>
238
239 <ResizeGrip x:Name="PART_Dragger"
240 Grid.Row="3"
241 Margin="3.5"
242 VerticalAlignment="Stretch" HorizontalAlignment="Center"
243 Style="{StaticResource VisibleResizeGrip}" />
244 </Grid>
245
246 <Grid Grid.Column="0" Margin="3.5">
247 <ContentPresenter x:Name="PART_ContentPresenter"
248 Content="{TemplateBinding Content}"
249 ContentTemplate="{TemplateBinding ContentTemplate}"
250 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
251 VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
252 </Grid>
253 </Grid>
254
255 <ControlTemplate.Triggers>
256 <Trigger Property="IsMouseOver" Value="True">
257 <Setter TargetName="SideBar" Property="Visibility" Value="Visible" />
258 <Setter TargetName="Chrome" Property="Visibility" Value="Visible" />
259 <Setter TargetName="Chrome" Property="Opacity" Value="0.15" />
260 </Trigger>
261
262 <Trigger Property="IsMouseOver" Value="False">
263 <Setter TargetName="SideBar" Property="Visibility" Value="Hidden" />
264 </Trigger>
265
266 <EventTrigger RoutedEvent="Activated">
267 <EventTrigger.Actions>
268 <BeginStoryboard>
269 <Storyboard>
270 <DoubleAnimation Storyboard.TargetProperty="Opacity"
271 BeginTime="0:0:0"
272 To="1.0"
273 Duration="0:0:1" />
274 </Storyboard>
275 </BeginStoryboard>
276 </EventTrigger.Actions>
277 </EventTrigger>
278 <EventTrigger RoutedEvent="Deactivated">
279 <EventTrigger.Actions>
280 <BeginStoryboard>
281 <Storyboard>
282 <DoubleAnimation Storyboard.TargetProperty="Opacity"
283 BeginTime="0:0:0"
284 To="0.85"
285 Duration="0:0:1" />
286 </Storyboard>
287 </BeginStoryboard>
288 </EventTrigger.Actions>
289 </EventTrigger>
290 </ControlTemplate.Triggers>
291 </ControlTemplate>
292 </Setter.Value>
293 </Setter>
294 </Style>
295
296 </ResourceDictionary>