Mercurial > silverbladetech
comparison Chronosv2/source/Themes/Metro/ShortcutStyles.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:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" | |
4 xmlns:chronos="http://chronos/schemas/2010/xaml"> | |
5 | |
6 <!-- Global Settings--> | |
7 <ResourceDictionary.MergedDictionaries> | |
8 <ResourceDictionary Source="Colors.xaml"/> | |
9 <ResourceDictionary Source="Brushes.xaml"/> | |
10 <ResourceDictionary Source="Fonts.xaml"/> | |
11 <ResourceDictionary Source="CoreStyles.xaml"/> | |
12 </ResourceDictionary.MergedDictionaries> | |
13 | |
14 <!--Converters--> | |
15 <chronos:StringToStyleConverter x:Key="StringToStyleConverter" /> | |
16 | |
17 <!--Shortcut style--> | |
18 <Style TargetType="{x:Type chronos:ShortcutElement}"> | |
19 <Setter Property="Id" Value="{Binding Id}"/> | |
20 <Setter Property="Foreground" Value="{StaticResource ShortcutTextBrush}" /> | |
21 <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" /> | |
22 <Setter Property="FontSize" Value="{StaticResource ShortcutFontSize}" /> | |
23 <Setter Property="HorizontalContentAlignment" Value="Stretch"/> | |
24 <Setter Property="VerticalContentAlignment" Value="Stretch"/> | |
25 <Setter Property="CanResize" Value="False" /> | |
26 <Setter Property="ConstraintToParent" Value="True" /> | |
27 <Setter Property="Background" Value="Transparent" /> | |
28 <Setter Property="AllowDrop" Value="False" /> | |
29 <Setter Property="Width" Value="{x:Static SystemParameters.IconGridWidth}" /> | |
30 <Setter Property="Height" Value="{x:Static SystemParameters.IconGridHeight}" /> | |
31 <Setter Property="AllowDrop" Value="False" /> | |
32 <Setter Property="ContextMenu"> | |
33 <Setter.Value> | |
34 <ContextMenu HasDropShadow="True"> | |
35 <MenuItem Header="Abrir ..." Command="{Binding OpenCommand}"/> | |
36 <MenuItem Header="Eliminar" Command="{Binding CloseCommand}"/> | |
37 <Separator/> | |
38 <MenuItem Header="Agrupar" Command="{x:Static chronos:Desktop.GroupCommand}" /> | |
39 </ContextMenu> | |
40 </Setter.Value> | |
41 </Setter> | |
42 <Setter Property="Template"> | |
43 <Setter.Value> | |
44 <ControlTemplate TargetType="{x:Type chronos:ShortcutElement}"> | |
45 <Grid Background="Transparent" | |
46 Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> | |
47 | |
48 <Border x:Name="PART_Dragger" | |
49 CornerRadius="3" | |
50 BorderThickness="2" | |
51 Opacity="0" | |
52 BorderBrush="#FF7AA3D4" | |
53 Background="#FFC5D5E9"> | |
54 <Border.InputBindings> | |
55 <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding OpenCommand}" /> | |
56 </Border.InputBindings> | |
57 </Border> | |
58 | |
59 <Grid IsHitTestVisible="False" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="3.5"> | |
60 <Grid.RowDefinitions> | |
61 <RowDefinition Height="40" /> | |
62 <RowDefinition Height="*" /> | |
63 </Grid.RowDefinitions> | |
64 | |
65 <Border x:Name="ShortcutIcon" | |
66 Grid.Row="0" | |
67 HorizontalAlignment="Center" VerticalAlignment="Top" Margin="3.5"> | |
68 <Path Fill="{TemplateBinding Foreground}" | |
69 Height="22" Width="34" | |
70 Style="{Binding IconStyle, Converter={StaticResource StringToStyleConverter}}"/> | |
71 </Border> | |
72 | |
73 <TextBlock x:Name="ShortcutTitle" | |
74 Grid.Row="1" | |
75 FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" | |
76 Text="{Binding Title}" | |
77 IsHitTestVisible="False" | |
78 HorizontalAlignment="Center" VerticalAlignment="Top" | |
79 TextAlignment="Center" TextWrapping="Wrap" /> | |
80 </Grid> | |
81 </Grid> | |
82 | |
83 <ControlTemplate.Triggers> | |
84 <MultiTrigger> | |
85 <MultiTrigger.Conditions> | |
86 <Condition SourceName="PART_Dragger" Property="IsMouseOver" Value="True" /> | |
87 <Condition Property="IsActive" Value="True" /> | |
88 </MultiTrigger.Conditions> | |
89 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.90" /> | |
90 </MultiTrigger> | |
91 | |
92 <MultiTrigger> | |
93 <MultiTrigger.Conditions> | |
94 <Condition SourceName="PART_Dragger" Property="IsMouseOver" Value="True" /> | |
95 <Condition Property="IsActive" Value="false" /> | |
96 </MultiTrigger.Conditions> | |
97 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.40" /> | |
98 </MultiTrigger> | |
99 | |
100 <Trigger Property="IsActive" Value="True"> | |
101 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.80" /> | |
102 </Trigger> | |
103 | |
104 <Trigger Property="IsSelected" Value="True"> | |
105 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.80" /> | |
106 </Trigger> | |
107 </ControlTemplate.Triggers> | |
108 </ControlTemplate> | |
109 </Setter.Value> | |
110 </Setter> | |
111 </Style> | |
112 | |
113 <!--Shortcut Group style--> | |
114 <Style TargetType="{x:Type chronos:ShortcutGroupElement}"> | |
115 <Setter Property="Id" Value="{Binding Id}"/> | |
116 <Setter Property="Foreground" Value="{StaticResource ShortcutTextBrush}" /> | |
117 <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" /> | |
118 <Setter Property="FontSize" Value="{StaticResource ShortcutFontSize}" /> | |
119 <Setter Property="HorizontalContentAlignment" Value="Stretch"/> | |
120 <Setter Property="VerticalContentAlignment" Value="Stretch"/> | |
121 <Setter Property="CanResize" Value="False" /> | |
122 <Setter Property="ConstraintToParent" Value="True" /> | |
123 <Setter Property="Background" Value="Transparent" /> | |
124 <Setter Property="AllowDrop" Value="False" /> | |
125 <Setter Property="Width" Value="{x:Static SystemParameters.IconGridWidth}" /> | |
126 <Setter Property="Height" Value="{x:Static SystemParameters.IconGridHeight}" /> | |
127 <Setter Property="AllowDrop" Value="False" /> | |
128 <Setter Property="ContextMenu"> | |
129 <Setter.Value> | |
130 <ContextMenu HasDropShadow="True"> | |
131 <MenuItem Header="Eliminar" Command="{Binding CloseCommand}"/> | |
132 </ContextMenu> | |
133 </Setter.Value> | |
134 </Setter> | |
135 <Setter Property="Template"> | |
136 <Setter.Value> | |
137 <ControlTemplate TargetType="{x:Type chronos:ShortcutGroupElement}"> | |
138 <Grid x:Name="Root" Background="Transparent" | |
139 Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> | |
140 | |
141 <Border x:Name="PART_Dragger" | |
142 CornerRadius="3" | |
143 BorderThickness="2" | |
144 Opacity="0" | |
145 BorderBrush="#FF7AA3D4" | |
146 Background="#FFC5D5E9"> | |
147 </Border> | |
148 | |
149 <Grid IsHitTestVisible="False" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="3.5"> | |
150 <Grid.RowDefinitions> | |
151 <RowDefinition Height="40" /> | |
152 <RowDefinition Height="*" /> | |
153 </Grid.RowDefinitions> | |
154 | |
155 <Border x:Name="ShortcutIcon" | |
156 Grid.Row="0" | |
157 HorizontalAlignment="Center" VerticalAlignment="Top" Margin="3.5"> | |
158 <Path Fill="{TemplateBinding Foreground}" | |
159 Height="22" Width="34" | |
160 Style="{Binding IconStyle, Converter={StaticResource StringToStyleConverter}}"/> | |
161 </Border> | |
162 | |
163 <TextBlock x:Name="ShortcutTitle" | |
164 Grid.Row="1" | |
165 FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" | |
166 Text="{Binding Title}" | |
167 IsHitTestVisible="False" | |
168 HorizontalAlignment="Center" VerticalAlignment="Top" | |
169 TextAlignment="Center" TextWrapping="Wrap" /> | |
170 </Grid> | |
171 | |
172 <Popup x:Name="ShortcutsView" | |
173 AllowsTransparency="True" | |
174 Focusable="True" StaysOpen="True" | |
175 Placement="Top" PlacementTarget="{Binding ElementName=Root}" | |
176 PopupAnimation="Slide"> | |
177 | |
178 <Border Margin="5" Effect="{StaticResource DropShadowBrush}" | |
179 Background="{StaticResource WindowBackgroundBrush}" | |
180 ScrollViewer.HorizontalScrollBarVisibility="Disabled" | |
181 ScrollViewer.VerticalScrollBarVisibility="Auto"> | |
182 <ItemsControl ItemsSource="{Binding Shortcuts}" Margin="20"> | |
183 <ItemsControl.ItemsPanel> | |
184 <ItemsPanelTemplate> | |
185 <UniformGrid /> | |
186 </ItemsPanelTemplate> | |
187 </ItemsControl.ItemsPanel> | |
188 <ItemsControl.ItemTemplate> | |
189 <DataTemplate> | |
190 <Grid Background="Transparent" | |
191 Margin="5" | |
192 Width="{x:Static SystemParameters.IconGridWidth}" | |
193 Height="{x:Static SystemParameters.IconGridHeight}"> | |
194 <Border x:Name="PART_Dragger" | |
195 CornerRadius="3" | |
196 BorderThickness="2" | |
197 Opacity="0" | |
198 BorderBrush="#FF7AA3D4" | |
199 Background="#FFC5D5E9"> | |
200 <Border.InputBindings> | |
201 <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding OpenCommand}" /> | |
202 </Border.InputBindings> | |
203 </Border> | |
204 | |
205 <Grid IsHitTestVisible="False" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="3.5"> | |
206 <Grid.RowDefinitions> | |
207 <RowDefinition Height="40" /> | |
208 <RowDefinition Height="*" /> | |
209 </Grid.RowDefinitions> | |
210 | |
211 <Border x:Name="ShortcutIcon" | |
212 Grid.Row="0" | |
213 HorizontalAlignment="Center" VerticalAlignment="Top" Margin="3.5"> | |
214 <Path Fill="{StaticResource ShortcutTextBrush}" | |
215 Height="22" Width="34" | |
216 Style="{Binding IconStyle, Converter={StaticResource StringToStyleConverter}}"/> | |
217 </Border> | |
218 | |
219 <TextBlock x:Name="ShortcutTitle" | |
220 Grid.Row="1" | |
221 FontFamily="{StaticResource ContentFontFamily}" FontSize="{StaticResource ShortcutFontSize}" Foreground="{StaticResource ShortcutTextBrush}" | |
222 Text="{Binding Title}" | |
223 IsHitTestVisible="False" | |
224 HorizontalAlignment="Center" VerticalAlignment="Top" | |
225 TextAlignment="Center" TextWrapping="Wrap" /> | |
226 </Grid> | |
227 </Grid> | |
228 <DataTemplate.Triggers> | |
229 <MultiTrigger> | |
230 <MultiTrigger.Conditions> | |
231 <Condition SourceName="PART_Dragger" Property="IsMouseOver" Value="True" /> | |
232 </MultiTrigger.Conditions> | |
233 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.90" /> | |
234 </MultiTrigger> | |
235 </DataTemplate.Triggers> | |
236 </DataTemplate> | |
237 </ItemsControl.ItemTemplate> | |
238 </ItemsControl> | |
239 </Border> | |
240 </Popup> | |
241 </Grid> | |
242 | |
243 <ControlTemplate.Triggers> | |
244 <MultiTrigger> | |
245 <MultiTrigger.Conditions> | |
246 <Condition SourceName="PART_Dragger" Property="IsMouseOver" Value="True" /> | |
247 <Condition Property="IsActive" Value="True" /> | |
248 </MultiTrigger.Conditions> | |
249 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.90" /> | |
250 </MultiTrigger> | |
251 | |
252 <MultiTrigger> | |
253 <MultiTrigger.Conditions> | |
254 <Condition SourceName="PART_Dragger" Property="IsMouseOver" Value="True" /> | |
255 <Condition Property="IsActive" Value="false" /> | |
256 </MultiTrigger.Conditions> | |
257 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.40" /> | |
258 </MultiTrigger> | |
259 | |
260 <Trigger Property="IsActive" Value="True"> | |
261 <Setter TargetName="PART_Dragger" Property="Opacity" Value="0.80" /> | |
262 </Trigger> | |
263 | |
264 <Trigger Property="IsActive" Value="False"> | |
265 <Setter TargetName="ShortcutsView" Property="IsOpen" Value="False" /> | |
266 </Trigger> | |
267 | |
268 <EventTrigger RoutedEvent="Deactivated"> | |
269 <BeginStoryboard> | |
270 <Storyboard> | |
271 <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ShortcutsView" | |
272 Storyboard.TargetProperty="IsOpen" | |
273 Duration="0:0:0"> | |
274 <DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:0" /> | |
275 </BooleanAnimationUsingKeyFrames> | |
276 </Storyboard> | |
277 </BeginStoryboard> | |
278 </EventTrigger> | |
279 | |
280 <EventTrigger RoutedEvent="MouseDoubleClick"> | |
281 <BeginStoryboard> | |
282 <Storyboard> | |
283 <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ShortcutsView" | |
284 Storyboard.TargetProperty="IsOpen" | |
285 Duration="0:0:0"> | |
286 <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:0" /> | |
287 </BooleanAnimationUsingKeyFrames> | |
288 </Storyboard> | |
289 </BeginStoryboard> | |
290 </EventTrigger> | |
291 </ControlTemplate.Triggers> | |
292 </ControlTemplate> | |
293 </Setter.Value> | |
294 </Setter> | |
295 </Style> | |
296 | |
297 </ResourceDictionary> |