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

style of headercontent

1 Answer 44 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Jingmeng
Top achievements
Rank 1
Jingmeng asked on 22 Sep 2011, 03:41 AM
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

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 27 Sep 2011, 08:19 AM
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 >>

Tags
TabControl
Asked by
Jingmeng
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or