public static ControlTemplate CreateControlTemplate() { var createMethod = new Func <UIElement, UIElement>(CreateControlTemplateCreateWindowUIElement); var controlTemplate = new ControlTemplate(typeof(Window), createMethod); var item = CommonHelpers.CreateBackgroundBorderForegroundTrigger(Window.IsActiveProperty, true, CommonResourceKeys.WindowActiveBrushKey, null, CommonResourceKeys.ItemTextSelectedColorKey, "PART_WindowTitleBorder"); controlTemplate.Triggers.Add(item); return(controlTemplate); }