class AttachedPropertIEs : DependencyObject{ #region RegisterBlackoutDates // Adds a collection of command bindings to a date picker's existing BlackoutDates collection,since the collections are immutable and can't be bound to otherwise. // // Usage: <DatePicker Hacks:AttachedPropertIEs.RegisterBlackoutDates="{Binding BlackoutDates}" > public static DependencyProperty RegisterBlackoutDatesProperty = DependencyProperty.Registerattached("RegisterBlackoutDates",typeof(System.windows.Controls.CalendarBlackoutDatesCollection),typeof(AttachedPropertIEs),new PropertyMetadata(null,OnRegisterCommandBindingChanged)); public static voID SetRegisterBlackoutDates(UIElement element,System.windows.Controls.CalendarBlackoutDatesCollection value) { if (element != null) element.SetValue(RegisterBlackoutDatesProperty,value); } public static System.windows.Controls.CalendarBlackoutDatesCollection GetRegisterBlackoutDates(UIElement element) { return (element != null ? (System.windows.Controls.CalendarBlackoutDatesCollection)element.GetValue(RegisterBlackoutDatesProperty) : null); } 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); } } } } #endregion}
我相信我太晚了,不能帮助你,但希望别人会觉得有用.
总结以上是内存溢出为你收集整理的c# – 如何绑定WPF工具包中的日程表日历控件?全部内容,希望文章能够帮你解决c# – 如何绑定WPF工具包中的日程表日历控件?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)