예제 #1
0
        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;
        }
예제 #2
0
        private void AddDragHandler()
        {
            RemoveDragHandler();

            if ((TitleBarGrid != null) && !TitleBarBackground.IsTransparent())
            {
                TitleBarGrid.MouseLeftButtonDown += OnDrag;
            }
            else
            {
                this.MouseLeftButtonDown += OnDrag;
            }
        }