WPF如何在选项卡项中获取选定的选项卡颜色

WPF how to get selected tab colour in a tab item

如何在 tabitem 中获取选定的颜色?

我想用它来改变背景:

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

并尝试了所有的可能性,但没有得到正确的选择

试试这个:

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