private void Apply() { var titleBar = TitleBar; titleBar.ForegroundColor = this.ForegroundColor; titleBar.BackgroundColor = this.BackgroundColor; titleBar.InactiveForegroundColor = this.InactiveForegroundColor; titleBar.InactiveBackgroundColor = this.InactiveBackgroundColor; titleBar.ButtonForegroundColor = this.ButtonForegroundColor; titleBar.ButtonBackgroundColor = this.ButtonBackgroundColor; titleBar.ButtonHoverForegroundColor = this.ButtonHoverForegroundColor; titleBar.ButtonHoverBackgroundColor = this.ButtonHoverBackgroundColor; titleBar.ButtonPressedForegroundColor = this.ButtonPressedForegroundColor; titleBar.ButtonPressedBackgroundColor = this.ButtonPressedBackgroundColor; titleBar.ButtonInactiveForegroundColor = this.ButtonInactiveForegroundColor; titleBar.ButtonInactiveBackgroundColor = this.ButtonInactiveBackgroundColor; _owner = this; }
private void Unapply() { if (_owner != this) { return; } _owner = null; var titleBar = TitleBar; titleBar.ForegroundColor = null; titleBar.BackgroundColor = null; titleBar.InactiveForegroundColor = null; titleBar.InactiveBackgroundColor = null; titleBar.ButtonForegroundColor = null; titleBar.ButtonBackgroundColor = null; titleBar.ButtonHoverForegroundColor = null; titleBar.ButtonHoverBackgroundColor = null; titleBar.ButtonPressedForegroundColor = null; titleBar.ButtonPressedBackgroundColor = null; titleBar.ButtonInactiveForegroundColor = null; titleBar.ButtonInactiveBackgroundColor = null; }