Tag: xaml binding

Wpf自定义datepicker用户控件

我想创建一个用户控件来获取用户的日期。 它应该有三个文本框,一个用于年,月和日。 我不知道如何创建它。 代码背后 public partial class ChooseDateControl : UserControl { public static readonly DependencyProperty ValueProperty; public static readonly DependencyProperty YearProperty; public static readonly DependencyProperty MonthProperty; public static readonly DependencyProperty DayProperty; static ChooseDateControl() { ValueProperty = DependencyProperty.Register( “Value”, typeof(DateTime), typeof(ChooseDateControl), new FrameworkPropertyMetadata(DateTime.MinValue)); ValueProperty = DependencyProperty.Register( “Year”, typeof(int), typeof(ChooseDateControl), new FrameworkPropertyMetadata((int)0)); ValueProperty = DependencyProperty.Register( “Month”, typeof(int), […]