style of headercontent

2 posts, 0 answers
  1. Jingmeng
    Jingmeng avatar
    18 posts
    Member since:
    Jun 2010

    Posted 21 Sep 2011 Link to this post

    hey all, i have a question about tabcontrol, if i set up the tabcontrol style first,like
    var s = new Style(typeof(RadTabItem));
    s.Setters.Add(new Setter(RadTabItem.HeaderTemplateProperty, App.Current.Resources["ColorTabHeader"] as DataTemplate));
    radTabThing.ItemContainerStyle = s;

    <DataTemplate x:Key="ColorTabHeader">
            <ContentControl Content="{Binding Header}" Foreground="{Binding FontColor}"  />

    and during the runtime, i'd like change the fontcolor of tabheader to red (default is set up as black),  how can i do it?

    cheers all
  2. Petar Mladenov
    Petar Mladenov avatar
    3131 posts

    Posted 27 Sep 2011 Link to this post

    Hello Jingmeng,

    I prepared a project for you ( based on your code) that changes the Foreground of the RadTabItems by changing the corresponding property in the ViewModels. Please check it out and let us know if it fits in your scenario.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top