private static void OnBindedDatesChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { var calendar = obj as Calendar; var context = GetBindContext(calendar); if (context == null) { SetBindContext(calendar, context = new CalendarDatesBindContext(calendar, e.NewValue as DatesCollection)); } else { context.Collection = e.NewValue as DatesCollection; } }
public static void SetBindContext(DependencyObject element, CalendarDatesBindContext value) { element.SetValue(BindContextProperty, value); }