comparison Chronosv2/source/Presentation/Widgets/Clock/ClockWidgetView.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 <chronos:WidgetElement x:Class="Chronos.Presentation.Widgets.ClockWidgetView"
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
5 xmlns:chronos="http://chronos/schemas/2010/xaml"
6 Style="{StaticResource DefaultGadgetStyle}"
7 Title="Digital clock">
8
9 <chronos:WidgetElement.Resources>
10 <SolidColorBrush x:Key="MainColor" Color="{StaticResource AccentColorBlue}" PresentationOptions:Freeze="True" />
11 <SolidColorBrush x:Key="MainColor2" Color="{StaticResource AccentColorLightBlue}" PresentationOptions:Freeze="True" />
12 <SolidColorBrush x:Key="ShadowColor" Color="#BB000000" PresentationOptions:Freeze="True" />
13
14 <Style x:Key="TimeStyle" TargetType="{x:Type TextBlock}">
15 <Setter Property="VerticalAlignment" Value="Center" />
16 <Setter Property="HorizontalAlignment" Value="Center" />
17 <Setter Property="Foreground" Value="{StaticResource MainColor}" />
18 <Setter Property="FontFamily" Value="Trebuchet MS" />
19 <Setter Property="FontSize" Value="90" />
20 </Style>
21 <Style x:Key="DateStyle" BasedOn="{StaticResource TimeStyle}" TargetType="{x:Type TextBlock}">
22 <Setter Property="HorizontalAlignment" Value="Right" />
23 <Setter Property="FontSize" Value="20" />
24 <Setter Property="FontWeight" Value="Bold" />
25 </Style>
26 </chronos:WidgetElement.Resources>
27
28 <Grid x:Name="MainGrid">
29 <Grid x:Name="ClockGrid" Panel.ZIndex="100">
30 <Grid.RowDefinitions>
31 <RowDefinition Height="Auto" />
32 <RowDefinition Height="Auto" />
33 </Grid.RowDefinitions>
34 <StackPanel Grid.Row="0" Orientation="Horizontal">
35 <TextBlock
36 Style="{StaticResource ResourceKey=TimeStyle}"
37 Text="{Binding Path=Hours}"></TextBlock>
38 <TextBlock
39 Style="{StaticResource ResourceKey=TimeStyle}"
40 Margin="0,-15,0,0"
41 Text=":"></TextBlock>
42 <TextBlock
43 Style="{StaticResource ResourceKey=TimeStyle}"
44 Margin="0,0,15,0"
45 Text="{Binding Path=Minutes}"></TextBlock>
46 <TextBlock
47 Style="{StaticResource ResourceKey=DateStyle}"
48 Margin="0,0,15,20"
49 VerticalAlignment="Bottom"
50 Text="{Binding Path=PmAm}"></TextBlock>
51 <Viewbox Grid.Column="1" Height="100" Width="100">
52 <Grid>
53 <Ellipse Width="220" Height="220" StrokeThickness="20" Stroke="{StaticResource MainColor2}" />
54 <Path Width="220" Height="220" StrokeThickness="20" Stroke="{StaticResource MainColor}">
55 <Path.Data>
56 <PathGeometry>
57 <PathFigure StartPoint="{Binding Path=DegreeStartPoint}" x:Name="pathF">
58 <ArcSegment
59 x:Name="arc"
60 Size="100 100"
61 SweepDirection="Clockwise"
62 Point="{Binding Path=DegreeCurrentPoint}"
63 IsLargeArc="{Binding Path=IsLargeArc}" />
64 </PathFigure>
65 </PathGeometry>
66 </Path.Data>
67 </Path>
68 <TextBlock
69 Style="{StaticResource ResourceKey=TimeStyle}"
70 FontSize="120"
71 Text="{Binding Path=Seconds}"></TextBlock>
72 </Grid>
73 </Viewbox>
74 </StackPanel>
75 <Grid
76 Grid.Row="1"
77 Margin="0,-15,90,0"
78 HorizontalAlignment="Right"
79 VerticalAlignment="Top">
80 <Grid.RowDefinitions>
81 <RowDefinition Height="Auto" />
82 <RowDefinition Height="Auto" />
83 </Grid.RowDefinitions>
84 <TextBlock
85 Grid.Row="0"
86 Style="{StaticResource ResourceKey=DateStyle}"
87 Text="{Binding Path=Date}">
88 </TextBlock>
89 <TextBlock
90 Grid.Row="1"
91 Margin="0,0,-27,0"
92 Style="{StaticResource ResourceKey=DateStyle}"
93 Text="{Binding Path=DayOfWeek}">
94 </TextBlock>
95 </Grid>
96 </Grid>
97 <Grid.LayoutTransform>
98 <RotateTransform Angle="{Binding Path=Angle}"></RotateTransform>
99 </Grid.LayoutTransform>
100 </Grid>
101 </chronos:WidgetElement>