WPF how to get selected tab colour in a tab item

439 Views Asked by At

How can I get the selected colour in a tabitem?

enter image description here

I want to use it to change the background:

t.Background = new SolidColorBrush(SystemColors.WindowColor);

and have tried all possibilities but didn't get the right one

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

Try this:

Brush brsTabSelected = default(Brush);
private void WindowViewBase_Loaded(object sender, RoutedEventArgs e)
{
  tabItem1.IsSelected = true;
  brsTabSelected = tabItem1.Background;
}