This is a migrated thread and some comments may be shown as answers.

DatePicker ApplicationBarButton Style

3 Answers 50 Views
DatePicker and DateSelector
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Danny
Top achievements
Rank 1
Danny asked on 01 Mar 2014, 11:03 AM
Hi,

I am trying to style various sections of the RadDatePicker and have been following this post http://www.telerik.com/forums/raddatepicker-styling-ca40c530355b

I am now trying to change the pressed visual state of the application bar buttons. Currently when you press the application bar button to confirm or cancel your selected date, it is a red colour. How do I change this colour?

Thanks

Danny 

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 06 Mar 2014, 11:27 AM
Hello Danny,

Thanks for writing and for your questions.

The application bar buttons are not styleable. Their visual appearance is determined by the Windows Phone OS and the current accent color settings. This is so because the application bar is part of the OS, not of the application itself.

Regards,
Deyan
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Danny
Top achievements
Rank 1
answered on 06 Mar 2014, 10:15 PM
Hi Deyan,

Thanks for your response, I thought this might be the case.

I have however managed to get it to work.

1. For Xaml controls, override the PhoneAccentColor in the constructor of the App.xaml file:

(App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color = Colors.Yellow;

(Note this doesn't work for controls such as the Application Bar Buttons)

2. To style Application Bar Buttons (when designing apps that have specific branding):

By default, Microsoft uses the PhoneAccentBrush for the pressed visual state. If you change the ForegroundColor property of the appbar to any other color except for white or black (light / dark themes respectfully), the OS will use the defined ForegroundColor. 
<telerikPrimitives:RadPickerBox.ApplicationBarInfo>
         <telerikPrimitives:ApplicationBarInfo x:Name="PART_AppBarInfo" ForegroundColor="#688C00">   
                   <telerikPrimitives:ApplicationBarButton x:Name="PART_OKButton" />                     
                    <telerikPrimitives:ApplicationBarButton x:Name="PART_CancelButton"/>
          </telerikPrimitives:ApplicationBarInfo>
</telerikPrimitives:RadPickerBox.ApplicationBarInfo>

Regards
Danny




0
Deyan
Telerik team
answered on 07 Mar 2014, 08:31 AM
Hi Danny,

Great to see that you've found out a way to implement your scenario.

Just keep in mind that when you override the accent color in your app you might experience undesired behavior with other controls.

Let us know if you have any further questions or need assistance.

Regards,
Deyan
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Tags
DatePicker and DateSelector
Asked by
Danny
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Danny
Top achievements
Rank 1
Share this question
or