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">
        <Grid>
            <ContentControl Content="{Binding Header}" Foreground="{Binding FontColor}"  />
        </Grid>
    </DataTemplate>

    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
    Admin
    Petar Mladenov avatar
    2891 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 >>

  3. DevCraft banner
Back to Top