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

Changing Font foreground color when Rab tab get selected

3 Answers 163 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Rohit
Top achievements
Rank 1
Rohit asked on 03 Nov 2011, 06:33 AM
Hello,

A very good morning to everyone, I have started using telerik controls since last 15 days approx. I am using "RAD Tab" for silver light
through expression blend 4.

So the basic idea to modify the Rad Tab through expression blend in a normal which you do is edit a copy and you can change the
background color of the Tab border and others.

The main problem which I am facing and I am not getting that how to change the Font Foreground when you select the Tab. I did try various options I am able to change the border,background, Font normal and other customizations!

I am only stuck at how to change the font foreground color  when the Tab get selected as I have light grey and dark blue theme modifiedfor it. So in normal scenario the tab foregorund font is dark blue with a light grey gradient background and when the specific tab got selected The font foreground color should get changed to white with a blue background.

Can you please throw some light on it!


Thank You
Rohit Yog

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 07 Nov 2011, 06:41 PM
Hi Rohit,

 Please examine the attached project where a databinding approach is used to meet your requirements.
Feel free to ask if you need further assistance.

Kind regards,
Petar Mladenov
the Telerik team

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

0
Rohit
Top achievements
Rank 1
answered on 09 Nov 2011, 05:52 AM
Hi Petar,

Many thanks for the solution!, right now the solution which you have given is for instance we need to manually put that code so the
foreground color will get changed.

The current scenario at my end is that - We have create custom themes for all telerik controls which we are using for e.g Tab,Grid,button.
So what ever we modify the code get creates in you can say "style.xaml". One more thing whatever modifications we are doing is through expression blend..

So is there any exclusive way in which I can put the "Selected" style property in our style.xaml which of course will include all other styles like normal,mouse over and many other custom styles.

We have used this solution for creating custom themes:

1) http://www.telerik.com/help/silverlight/common-styling-apperance-themes-custom-theme-project-telerik-approach.html




Thank You
Rohit Yog
0
Petar Mladenov
Telerik team
answered on 11 Nov 2011, 05:22 PM
Hi Rohit,

 I am not sure I understand your exact requirement. If you need to move these resources in another file:

<Grid.Resources>
           
          <local:BoolToForegroundConverter x:Key="converter" />
           
          <telerik:ContainerBindingCollection x:Key="contCollection">
              <telerik:ContainerBinding PropertyName="Foreground" Binding="{Binding Selected, Converter={StaticResource converter}}" />
              <telerik:ContainerBinding PropertyName="Background" Binding="{Binding BackGroundColor}" />
              <telerik:ContainerBinding PropertyName="IsSelected" Binding="{Binding Selected, Mode=TwoWay}" />
          </telerik:ContainerBindingCollection>
 
          <DataTemplate x:Key="template" telerik:ContainerBinding.ContainerBindings="{StaticResource contCollection}">
              <TextBlock Text="{Binding Name}" />
          </DataTemplate>
      </Grid.Resources>
Yes it is possible. But if you need to use same Foreground for every RadTabItem, when it gets selected, yes you can edit the Selected VisualState of in the RadTabItem's Template and set animation that changes the foreground property. Feel free to ask if you need further assistance. Greetings,
Petar Mladenov
the Telerik team

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

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