Setting a static datetime in WPF/xaml

前端 未结 1 1133
野的像风
野的像风 2021-01-19 01:29

I\'m trying to blackout dates in my datetime picker control starting from day after today till datetime max value.

The below is the code:

    

        
相关标签:
1条回答
  • 2021-01-19 01:50

    You can create your own static property for this.

      public static class DateTimeHelper
      {
        public static DateTime Tomorrow
        {
          get { return DateTime.Today.AddDays(1); }
        }
      }
    

    .

      <CalendarDateRange Start="{x:Static app:DateTimeHelper.Tomorrow}"…
    
    0 讨论(0)
提交回复
热议问题