comparison Chronosv2/source/Presentation/Widgets/Clock/ClockWidgetView.xaml.cs @ 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 using System;
2 using System.Windows;
3 using Chronos.Presentation.Windows.Controls;
4
5 namespace Chronos.Presentation.Widgets
6 {
7 /// <summary>
8 /// Clock Widget View
9 /// </summary>
10 public partial class ClockWidgetView
11 : WidgetElement
12 {
13 #region · Dependency Properties ·
14
15 public static readonly DependencyProperty SecondsProperty = DependencyProperty.Register(
16 "Seconds", typeof(string), typeof(ClockWidgetView), new PropertyMetadata("00"));
17
18 public static readonly DependencyProperty MinutesProperty = DependencyProperty.Register(
19 "Minutes", typeof(string), typeof(ClockWidgetView), new PropertyMetadata("00"));
20
21 public static readonly DependencyProperty HoursProperty = DependencyProperty.Register(
22 "Hours", typeof(string), typeof(ClockWidgetView), new PropertyMetadata("00"));
23
24 public static readonly DependencyProperty PmAmProperty = DependencyProperty.Register(
25 "PmAm", typeof(string), typeof(ClockWidgetView), new PropertyMetadata(string.Empty));
26
27 public static readonly DependencyProperty Hours24Property = DependencyProperty.Register(
28 "Hours24", typeof(bool), typeof(ClockWidgetView), new PropertyMetadata(true));
29
30 public static readonly DependencyProperty DateProperty = DependencyProperty.Register(
31 "Date", typeof(string), typeof(ClockWidgetView), new PropertyMetadata(String.Empty));
32
33 public static readonly DependencyProperty DayOfWeekProperty = DependencyProperty.Register(
34 "DayOfWeek", typeof(string), typeof(ClockWidgetView), new PropertyMetadata(String.Empty));
35
36 public static readonly DependencyProperty AngleProperty = DependencyProperty.Register(
37 "Angle", typeof(int), typeof(ClockWidgetView), new PropertyMetadata(0));
38
39 #endregion
40
41 #region · Properties ·
42
43 public string Seconds
44 {
45 get { return (string)this.GetValue(SecondsProperty); }
46 set { this.SetValue(SecondsProperty, value); }
47 }
48
49 public string Minutes
50 {
51 get { return (string)this.GetValue(MinutesProperty); }
52 set { this.SetValue(MinutesProperty, value); }
53 }
54
55 public string Hours
56 {
57 get { return (string)this.GetValue(HoursProperty); }
58 set { this.SetValue(HoursProperty, value); }
59 }
60
61 public string PmAm
62 {
63 get { return (string)this.GetValue(PmAmProperty); }
64 set { this.SetValue(PmAmProperty, value); }
65 }
66
67 public bool Hours24
68 {
69 get { return (bool)this.GetValue(Hours24Property); }
70 set { this.SetValue(Hours24Property, value); }
71 }
72
73 public string Date
74 {
75 get { return (string)this.GetValue(DateProperty); }
76 set { this.SetValue(DateProperty, value); }
77 }
78
79 public string DayOfWeek
80 {
81 get { return (string)this.GetValue(DayOfWeekProperty); }
82 set { this.SetValue(DayOfWeekProperty, value); }
83 }
84
85 public int Angle
86 {
87 get { return (int)this.GetValue(AngleProperty); }
88 set { this.SetValue(AngleProperty, value); }
89 }
90
91 #endregion
92
93 #region · Constuctors ·
94
95 /// <summary>
96 /// Initializes a new instance of the <see cref="ClockWidgetView"/> class.
97 /// </summary>
98 public ClockWidgetView()
99 {
100 InitializeComponent();
101
102 this.DataContext = new ClockWidgetViewModel();
103 }
104
105 #endregion
106
107 #region · Methods ·
108
109 public override void OnApplyTemplate()
110 {
111 base.OnApplyTemplate();
112
113 ((ClockWidgetViewModel)this.DataContext).Start();
114 }
115
116 #endregion
117 }
118 }