Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/MahApps.Metro/Controls/MetroWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,35 @@
set => this.SetValue(NonActiveBorderBrushProperty, value);
}

/// <summary>Identifies the <see cref="GlowBrush"/> dependency property.</summary>
public static readonly DependencyProperty GlowBrushProperty
= DependencyProperty.Register(nameof(GlowBrush),
typeof(Brush),
typeof(MetroWindow),
new PropertyMetadata(default(Brush), OnGlowBrushChanged));

/// <summary>
/// Gets or sets the brush used for the glow effect of the window border when the window is active.
/// This property wraps the inherited <see cref="GlowColor"/> property from ControlzEx.
/// </summary>
public Brush GlowBrush

Check failure on line 572 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

Property 'MahApps.Metro.Controls.MetroWindow.GlowBrush' must be of type System.Windows.Media.Brush? (https://github.com/DotNetAnalyzers/WpfAnalyzers/tree/master/documentation/WPF0012.md)

Check failure on line 572 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

Property 'MahApps.Metro.Controls.MetroWindow.GlowBrush' must be of type System.Windows.Media.Brush? (https://github.com/DotNetAnalyzers/WpfAnalyzers/tree/master/documentation/WPF0012.md)

Check failure on line 572 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

Property 'MahApps.Metro.Controls.MetroWindow.GlowBrush' must be of type System.Windows.Media.Brush? (https://github.com/DotNetAnalyzers/WpfAnalyzers/tree/master/documentation/WPF0012.md)

Check failure on line 572 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

Property 'MahApps.Metro.Controls.MetroWindow.GlowBrush' must be of type System.Windows.Media.Brush? (https://github.com/DotNetAnalyzers/WpfAnalyzers/tree/master/documentation/WPF0012.md)

Check failure on line 572 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

Property 'MahApps.Metro.Controls.MetroWindow.GlowBrush' must be of type System.Windows.Media.Brush? (https://github.com/DotNetAnalyzers/WpfAnalyzers/tree/master/documentation/WPF0012.md)
{
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)

Check failure on line 584 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

A local or parameter named 'window' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter

Check failure on line 584 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

A local or parameter named 'window' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter

Check failure on line 584 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

A local or parameter named 'window' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter

Check failure on line 584 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

A local or parameter named 'window' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter

Check failure on line 584 in src/MahApps.Metro/Controls/MetroWindow.cs

View workflow job for this annotation

GitHub Actions / windows-latest

A local or parameter named 'window' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
{
window.GlowColor = null;
}
}

/// <summary>Identifies the <see cref="OverlayBrush"/> dependency property.</summary>
public static readonly DependencyProperty OverlayBrushProperty
= DependencyProperty.Register(nameof(OverlayBrush),
Expand Down
Loading