Limit date range in a DatePicker

2019-01-20 16:17发布

First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date

2条回答
Fickle 薄情
2楼-- · 2019-01-20 16:56

Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.

The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.

查看更多
Lonely孤独者°
3楼-- · 2019-01-20 17:08

I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.

These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.

查看更多
登录 后发表回答