Simple way to adjust NavigationHeader's (a border) background color?

11 posts, 0 answers
  1. Spurk
    Spurk avatar
    40 posts
    Member since:
    Feb 2012

    Posted 03 Jul 2013 Link to this post

    Is there a way to change simple elements that are nested inside the ScheduleView's ControlTemplate, like NavigationHeader -- for example the border's background colour--using Style Setters?

    Example: I'd like to apply the Windows8 theme, and then specify a different colour for NavigationHeader.

    It seems a shame to generate the ControlTemplate's 6100 some-odd lines of XAML to change some minor elements in the ScheduleView's ControlTemplate.
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 08 Jul 2013 Link to this post

    Hi,

    When customizing the Windows8Theme colors the easiest approach is by changing the Windows8Palette Palette colors. You can read this help article that described how to customize all of the Palette colors used in Windows8 and Windows8Touch themes.

    The next code snippet shows the how to change the navigation header color to orange:
    public MainWindow()
    {
        Windows8Palette.Palette.AccentColor = Colors.Orange;
        InitializeComponent();
    }

    Hope this is helpful.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Spurk
    Spurk avatar
    40 posts
    Member since:
    Feb 2012

    Posted 08 Jul 2013 Link to this post

    Vladi,

    Is there any way this can be done simply in XAML?
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 10 Jul 2013 Link to this post

    Hello,

    Unfortunately changing the colors of the Windows8 theme globally is only possible from the code behind. If you want to use an approach that uses only the XAML you will need to override the different Templates/Styles that you want to customize and add your custom colors to the different parts.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Spurk
    Spurk avatar
    40 posts
    Member since:
    Feb 2012

    Posted 11 Jul 2013 Link to this post

    Thank you Vladi,

    One further question;  when I use blend to generate a copy of the template to edit, I notice the view mode selection buttons from the left of the navigation header disappear...  does the generated control template not have them?

    Thanks,
    S
  7. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 16 Jul 2013 Link to this post

    Hi,

    There is a known issue logged here that is causing the bindings to get lost when the RadScheduleView ControlTempalte is generated with Blend. Unfortunately we are not aware of any workarounds to this issue caused by the extraction with Blend as the ScheduleView control is a complex control that requires lots of data bindings.

    If you cannot use the previously described approaches you could use Implicit Styles and customize the RadScheduleViewControlTemplate of the control.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Spurk
    Spurk avatar
    40 posts
    Member since:
    Feb 2012

    Posted 22 Sep 2013 Link to this post

    Vladi,

    When I navigate to c:\...\RadControls for WPF Q2 2013\Themes.Implicit\WPF40\WIndows8Touch and grab the contents of Telerik.Windows.ScheduleView.xaml to work from;  I copy the xaml into a resource dictionary of my current application, but I've run into two problems:

    1.  The Windows8Touch .PNG files seem to be missing--where can I get them?  (example:  Line 37 - AppointmentException_Metro.png)

    2.  On line 3308:  <local:Category CategoryName="Red Category" CategoryBrush="{StaticResource RedCategoryBrush}"/>  I'm getting the error: The property 'CategoryName' cannot be found in type 'Category' -- Is it possible I'm missing a reference?

    Any help is greatly appreciated.
  9. Spurk
    Spurk avatar
    40 posts
    Member since:
    Feb 2012

    Posted 22 Sep 2013 Link to this post

    Vladi,

    Two other questions... when using the Windows8Thouch theme, I notice that the current time indicator is missing, out of the box.

    Lastly,  If I want to adjust the height of the navigation header, what is the best way to have the elements below the navigation header to move up, instead of stretching, as demonstrated in the attached image?
  10. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 25 Sep 2013 Link to this post

    Hi Sheldon,

    The CurrentTimeIndicator is not shown by default - you need to set the ShowCurrentTimeIndicator property to true in order to show it.

    As for the TimeRuller height - you can find the TimeRulerItemTemplateSelector in the theme and set the height for the required template.

    Hope this will help you.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  11. Spurk
    Spurk avatar
    40 posts
    Member since:
    Feb 2012

    Posted 28 Sep 2013 Link to this post

    H Vladi -  I'm reposting these questions because I think you missed it:

    Vladi,

    When I navigate to c:\...\RadControls for WPF Q2 2013\Themes.Implicit\WPF40\WIndows8Touch and grab the contents of Telerik.Windows.ScheduleView.xaml to work from;  I copy the xaml into a resource dictionary of my current application, but I've run into two problems:

    1.  The Windows8Touch .PNG files seem to be missing--where can I get them?  (example:  Line 37 - AppointmentException_Metro.png)

    2.  On line 3308:  <local:Category CategoryName="Red Category" CategoryBrush="{StaticResource RedCategoryBrush}"/>  I'm getting the error: The property 'CategoryName' cannot be found in type 'Category' -- Is it possible I'm missing a reference?

    Any help is greatly appreciated.
  12. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 01 Oct 2013 Link to this post

    Hello Sheldon,

    We tried the explained and the errors with the missing PNG files also appear on our side, this is so because Visual Studio tries to resolve the source path of the images for the Design Time unsuccessfully. You can easily fix these incorrect the paths the following way:
    <ImageSource x:Key="AppointmentItem_Recurrence">pack://application:,,,/Telerik.Windows.Controls.ScheduleView;component/Themes/Images/AppointmentException_Metro.png</ImageSource>

    As for the missing brush we don't receive that error. I have attached here our ScheduleView ResourceDictionary file for your convenience.

    Hope this will help you.

    Regards,
    Kalin
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready