/// <summary> /// Header property changed handler /// </summary> /// <param name="d">TabItem that changed its Header.</param> /// <param name="e">DependencyPropertyChangedEventArgs.</param> private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { TabItem ctrl = (TabItem)d; ctrl.HasHeader = (e.NewValue != null) ? true : false; ctrl.OnHeaderChanged(e.OldValue, e.NewValue); }