Exemplo n.º 1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ClockControl c    = parameter as ClockControl;
            DateTime     date = (DateTime)value;

            return(date.Second * 6);// (date.Millisecond * .006);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Will be called every time the ClockControl.IsRunning property changes.
        /// </summary>
        private static void OnIsRunningInvalidated(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ClockControl clock = (ClockControl)d;

            bool oldValue = (bool)e.OldValue;
            bool newValue = (bool)e.NewValue;

            if (oldValue != newValue)
            {
                clock.OnIsRunningChanged(oldValue, newValue);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Will be called every time the ClockControl.DateTime property changes.
        /// </summary>
        private static void OnDateTimeInvalidated(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ClockControl clock = (ClockControl)d;

            DateTime oldValue = (DateTime)e.OldValue;
            DateTime newValue = (DateTime)e.NewValue;

            if (oldValue.Second != newValue.Second)
            {
                clock.OnDateTimeChanged(oldValue, newValue.AddMilliseconds(-newValue.Millisecond));
            }
        }