Beispiel #1
0
        private void DrawSecondsHand(ClockData clockData)
        {
            if (secondsHand != null && ClockHandsCanvas.Children.Contains(secondsHand))
            {
                ClockHandsCanvas.Children.Remove(secondsHand);
            }

            secondsHand = this.CreateHand(this.secondsHandWidth, this.secondsHandHeight,
                                          new SolidColorBrush(Colors.Black), 0, 0, 0, null);
            secondsHand.RenderTransform = this.CreateTransformGroup(
                clockData.Seconds * 6,
                -this.secondsHandWidth / 2,
                -this.secondsHandHeight + 4.25);

            if (ClockHandsCanvas.Children.Contains(secondsHand) == false)
            {
                ClockHandsCanvas.Children.Add(secondsHand);
            }
        }
Beispiel #2
0
        private void DrawHoursHand(ClockData clockData)
        {
            if (hoursHand != null && ClockHandsCanvas.Children.Contains(hoursHand))
            {
                ClockHandsCanvas.Children.Remove(hoursHand);
            }

            hoursHand = this.CreateHand(this.hoursHandWidth, this.hoursHandHeight,
                                        new SolidColorBrush(Colors.White), 0.6, 3, 3,
                                        new SolidColorBrush(Color.FromArgb(0x33, 0x33, 0x33, 0x33)));
            hoursHand.RenderTransform = this.CreateTransformGroup(
                30 * clockData.Hours + clockData.Minutes / 2 + clockData.Seconds / 120,
                -this.hoursHandWidth / 2,
                -this.hoursHandHeight + 4.25);

            if (ClockHandsCanvas.Children.Contains(hoursHand) == false)
            {
                ClockHandsCanvas.Children.Add(hoursHand);
            }
        }
Beispiel #3
0
 public ClockDataEventArgs(ClockData clockData)
 {
     this.ClockData = clockData;
 }