diff --git a/src/MahApps.Metro/Controls/MetroWindow.cs b/src/MahApps.Metro/Controls/MetroWindow.cs index c7eb7e8f1..1410e6814 100644 --- a/src/MahApps.Metro/Controls/MetroWindow.cs +++ b/src/MahApps.Metro/Controls/MetroWindow.cs @@ -558,6 +558,35 @@ public Brush NonActiveBorderBrush set => this.SetValue(NonActiveBorderBrushProperty, value); } + /// Identifies the dependency property. + public static readonly DependencyProperty GlowBrushProperty + = DependencyProperty.Register(nameof(GlowBrush), + typeof(Brush), + typeof(MetroWindow), + new PropertyMetadata(default(Brush), OnGlowBrushChanged)); + + /// + /// Gets or sets the brush used for the glow effect of the window border when the window is active. + /// This property wraps the inherited property from ControlzEx. + /// + public Brush GlowBrush + { + get => (Brush)this.GetValue(GlowBrushProperty); + set => this.SetValue(GlowBrushProperty, value); + } + + private static void OnGlowBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is MetroWindow window && e.NewValue is SolidColorBrush brush) + { + window.GlowColor = brush.Color; + } + else if (d is MetroWindow window && e.NewValue is null) + { + window.GlowColor = null; + } + } + /// Identifies the dependency property. public static readonly DependencyProperty OverlayBrushProperty = DependencyProperty.Register(nameof(OverlayBrush),