Ejemplo n.º 1
0
        private static void DateCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MonthDay monthDay = (MonthDay)d;
            DateTime newValue = (DateTime)e.NewValue;

            monthDay.ThreadSafeDate = newValue;
            monthDay.IsToday        = newValue == DateTime.Now.Date;
        }
Ejemplo n.º 2
0
        private static void DisplayTextCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MonthDay monthDay = (MonthDay)d;

            if (e.NewValue != null)
            {
                string[] split = ((string)e.NewValue).Split(' ');

                if (split.Length == 1)
                {
                    monthDay.ShortDisplayText = split[0];
                }
                else
                {
                    monthDay.ShortDisplayText = split[1].TrimEnd(',');
                }
            }
            else
            {
                monthDay.ShortDisplayText = null;
            }
        }
Ejemplo n.º 3
0
        private static void ClearAllCanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            MonthDay monthDay = (MonthDay)sender;

            e.CanExecute = monthDay.PART_StackPanel != null ? monthDay.PART_StackPanel.HasItems : false;
        }