For credit card expiry dates I needed to mod the Microsoft.Phone.Controls.DatePicker to only ask for Month and Year.
This was surprisingly convoluted but thanks for reflector, achievable. The xaml for the existing date picker is a resource in the dll but you do have to do a fair amount of work to keep it happy that it doesn’t have a day part anymore.
Seems to work and we’re on track for submitting the app tomorrow! 🙂
Are you talking about the /Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/DatePickerPage.xaml resource?How did you override that?
Indeed I am. You can override the xaml page used for the picker by setting PickerPageUri, e.g.
<toolkit:DatePicker PickerPageUri="/Views/MonthYearPicker.xaml"
Value="{Binding ExpiryDateSelectorValue, Mode=TwoWay}"
ValueStringFormat="{}{0:MM/yyyy}"
Margin="-10,0,0,0" />
Then provide a MonthYearPicker.xaml page which has some code to override the different datasources (such as YearDataSource etc.). You can use reflector to extract the existing DateTimePicker.xaml.
How did you use reflector to get the original xaml?
I associated .xaml files with notepad, then double clicking on them in reflector (see under Resources folder for the DLL)