Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable past dates in datapicker wpf is this possible

Tags:

wpf

I have a datapicker in wpf and I have to disable past dates. I am using a MVVM pattern. Is it possible?

How do you do it?

like image 323
user9969 Avatar asked Dec 16 '22 17:12

user9969


1 Answers

You can use the DisplayDateStart and DisplayDateEnd properties of DatePicker. They are dependencies properties so you can supply them via your DataContext using MVVM. Here's the documentation:

  • DatePicker.DisplayDateStart Property
  • DatePicker.DisplayDateEnd Property
like image 160
Rick Sladkey Avatar answered Feb 14 '23 22:02

Rick Sladkey