DatePicker ApplicationBarButton Style

4 posts, 0 answers
  1. Danny
    Danny avatar
    11 posts
    Member since:
    Sep 2013

    Posted 01 Mar 2014 Link to this post

    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 
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 06 Mar 2014 Link to this post

    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!

  3. DevCraft banner
  4. Danny
    Danny avatar
    11 posts
    Member since:
    Sep 2013

    Posted 06 Mar 2014 Link to this post

    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




  5. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 07 Mar 2014 Link to this post

    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.

Back to Top
DevCraft banner