public SideGlow(Side side) { _side = side; _canvas.Background = Brushes.Transparent; Content = _canvas; Width = Height = 0; _interopHelper = new WindowInteropHelper(this); WindowStyle = System.Windows.WindowStyle.None; AllowsTransparency = true; Background = Brushes.Transparent; ShowInTaskbar = false; InitializeAlphas(); InitializeLines(); UpdateLinesColor(); _winChrome = new WindowChrome { ResizeBorderThickness = new Thickness(0), CornerRadius = new CornerRadius(0), GlassFrameThickness = new Thickness(0), UseAeroCaptionButtons = false, CaptionHeight = 0 }; WindowChrome.SetWindowChrome(this, _winChrome); if (_side == Side.Top || _side == Side.Bottom) { Height = SIZE; } else { Width = SIZE; } }
public static void SetWindowChrome(Window window, WindowChrome chrome) { Verify.IsNotNull(window, "window"); window.SetValue(WindowChromeProperty, chrome); }
public void SetWindowChrome(WindowChrome newChrome) { VerifyAccess(); Assert.IsNotNull(_window); if (newChrome == _chromeInfo) { // Nothing's changed. return; } if (_chromeInfo != null) { _chromeInfo.PropertyChangedThatRequiresRepaint -= _OnChromePropertyChangedThatRequiresRepaint; } _chromeInfo = newChrome; if (_chromeInfo != null) { _chromeInfo.PropertyChangedThatRequiresRepaint += _OnChromePropertyChangedThatRequiresRepaint; } _ApplyNewCustomChrome(); }