private void ManageBackground() { if (!_isDueCheckBackground && !_isDueCheckDefaultChromeBackground) { return; } if (_isDueCheckDefaultChromeBackground) { var color = WindowChromeColor.GetChromeColor(); if (color.HasValue) { DefaultChromeBackground = new SolidColorBrush(color.Value); } } _chromeBackgroundActual = (UsesDefaultChromeBackground || ChromeBackground.IsTransparent()) ? DefaultChromeBackground : ChromeBackground; CaptionButtonBackground = TitleBarBackground.IsTransparent() ? _chromeBackgroundActual : TitleBarBackground; AddDragHandler(); _isDueCheckBackground = false; _isDueCheckDefaultChromeBackground = false; }
private void AddDragHandler() { RemoveDragHandler(); if ((TitleBarGrid != null) && !TitleBarBackground.IsTransparent()) { TitleBarGrid.MouseLeftButtonDown += OnDrag; } else { this.MouseLeftButtonDown += OnDrag; } }