views:

76

answers:

1

I'm using the DatePicker control from the WP7 SL toolkit. It navigates to DatePickerPage.xaml, which has the scrollers for date picking. I want to keep all the functionality, but change the colors. I'm messing around with DatePickerPage.xaml and updating colors to fit my needs.

I've been able to update the text colors on the scrollers and header, but I can't figure out how to update the background color on the selected item in each or the square outline while the scroller is active. Based on tests I have done with changing the background color of the DatePickerPage.xaml, it appears that the selected item and square outlines are an opaque version of the background color. Unfortunately, this wont work for me, since I want the background to the be white and the outlines aren't visible. Is there a way to explicitly set those colors?

+1  A: 

If you get the control into Blend and right click on it and select Edit Tempate --> Edit a Copy, you'll get the template for the control so that you can edit it.

What you'll be looking for is the resources keys that are used for the background, foreground, etc. You can replace them with your own resources, or hardcode them, or the best option is to override the resource.

Additional Advice

Be careful though, don't forget that a user can have either a dark or light background to the phone, so unless your app is taking control of the background color of the whole page, you need to consider what might happen when picking colors

Chris Nicol
This only allows the editing of the DatePicker in the "TextBox" view. Don't know exactly how to describe it, but the DatePicker has two states. One where you put it on a page and it looks like a text box, and a second when you click on the text box and it takes you to the actual picker with the scroll selectors. Following the Edit Template approach in Blend only allows you to edit the TextBox view.
CACuzcatlan
You can create your own page and have it navigate there, as described in this blog post http://blogs.msdn.com/b/delay/archive/2010/09/21/there-are-lots-of-ways-to-ask-for-a-date-creating-custom-datepicker-timepicker-experiences-is-easy-with-the-windows-phone-toolkit.aspx Unfortunately, there doesn't seem to be a way to edit the style of the scroll selector page without creating a new one
CACuzcatlan