private void Button_Click(object sender, RoutedEventArgs e)
{
this.tb.SelectedItem = this.tb.Items[1];
}
网友你好,我也是纠结了许久,但最终还是想到了关键代码如下,先拿到容器窗口,再通过将窗口的属性TabItem的选中状态变成true即可切换到对应页
Window currentWin = Application.Current.Mgen;
Mgen mgen= currentWin as Mgen ;
mgen.bbb.IsSelected = true;