예제 #1
0
 public static void SetRegisterBlackoutDates(UIElement element, System.Windows.Controls.CalendarBlackoutDatesCollection value)
 {
     if (element != null)
     {
         element.SetValue(RegisterBlackoutDatesProperty, value);
     }
 }
예제 #2
0
 private static void OnRegisterCommandBindingChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
 {
     System.Windows.Controls.DatePicker element = sender as System.Windows.Controls.DatePicker;
     if (element != null)
     {
         System.Windows.Controls.CalendarBlackoutDatesCollection bindings = e.NewValue as System.Windows.Controls.CalendarBlackoutDatesCollection;
         if (bindings != null)
         {
             element.BlackoutDates.Clear();
             foreach (var dateRange in bindings)
             {
                 element.BlackoutDates.Add(dateRange);
             }
         }
     }
 }