TransparentTheme example

2 posts, 0 answers
  1. Chris Ingrao
    Chris Ingrao avatar
    3 posts
    Member since:
    Jul 2010

    Posted 15 Sep 2011 Link to this post


    Could you provide an example of the TabControl.xaml in the TransparentTheme that sets the unselected tabs foreground color to white but leaves the selected tabs black?

  2. Zarko
    Zarko avatar
    755 posts

    Posted 20 Sep 2011 Link to this post

    Hello Chris Ingrao,
    The easiest way to achieve your desired behavior is to handle the SelectionChanged and in it set the foreground to the RadTabItems manually like this:
    private void myTab_SelectionChanged(object sender, Telerik.Windows.Controls.RadSelectionChangedEventArgs e)
        var tab = sender as RadTabControl;
        for (int i = 0; i < tab.Items.Count; i++)
            var container = tab.ItemContainerGenerator.ContainerFromIndex(i) as RadTabItem;
            if (container != null)
                if (i != tab.SelectedIndex)
                    container.Foreground = new SolidColorBrush(Colors.White);
                    container.Foreground = new SolidColorBrush(Colors.Black);
    For further references could you please examine the attached project and if you have more questions feel free to ask.

    Best wishes,
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top