我的wpf应用程序中有这个日期选择器:
<DataGridTemplateColumn Header="Date">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<DatePicker HorizontalAlignment="Left" VerticalAlignment="Top" SelectedDate="{Binding DateP, Mode=TwoWay, UpdateSourceTrigger=LostFocus}">
<DatePicker.BlackoutDates>
<CalendarDateRange End="01 /01 /02 "/>
</DatePicker.BlackoutDates>
</DatePicker>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
我想将 CalendarDateRange 的End
属性绑定到这样的日期时间属性:
<DatePicker.BlackoutDates>
<CalendarDateRange End="{Binding DateE1, Mode=TwoWay}"/>
<CalendarDateRange Start="{Binding DateS1, Mode=TwoWay}" End="{Binding DateE2, Mode=TwoWay}"/>
</DatePicker.BlackoutDates>