Skip to content

fix(MetroWindow): add GlowBrush dependency property (fixes #4564)#4568

Open
JyslaFancy wants to merge 1 commit into
MahApps:developfrom
JyslaFancy:fix/4564-glowbrush-metrowindow
Open

fix(MetroWindow): add GlowBrush dependency property (fixes #4564)#4568
JyslaFancy wants to merge 1 commit into
MahApps:developfrom
JyslaFancy:fix/4564-glowbrush-metrowindow

Conversation

@JyslaFancy

Copy link
Copy Markdown

Fixes #4564 — GlowBrush invalid property on MetroWindow.

Problem

The MahApps.Metro documentation references a GlowBrush property on MetroWindow, but this property was never implemented. Users following the docs example get 'GlowBrush invalid property' at design time.

Root cause

MetroWindow inherits GlowColor (Color?) from ControlzEx.WindowChromeWindow, but no GlowBrush convenience property was exposed.

Fix

Added a GlowBrush dependency property (of type Brush) that wraps the inherited GlowColor:

  • Setting GlowBrush to a SolidColorBrush extracts the Color and assigns it to GlowColor
  • Setting GlowBrush to null clears GlowColor
  • The getter returns the current GlowBrushProperty value

This matches the pattern used by other brush properties on MetroWindow (e.g. NonActiveBorderBrush).

…d GlowColor

The MahApps.Metro documentation references a GlowBrush property on MetroWindow,
but this property was never implemented. Users following the docs example get
'GlowBrush invalid property' at design time.

The MetroWindow already inherits GlowColor (of type Color?) from
ControlzEx.WindowChromeWindow. This commit adds a GlowBrush dependency property
(of type Brush) that wraps GlowColor:
- Setting GlowBrush extracts the Color from a SolidColorBrush and assigns GlowColor
- Getting GlowBrush returns null (the underlying value is GlowColor)
- Setting GlowBrush to null clears GlowColor

Fixes MahApps#4564
@BinToss

BinToss commented Jul 8, 2026

Copy link
Copy Markdown

I believe this should be changed in ControlzEx, instead. The GlowBrush/GlowColor issue originated from ControlzEx, after all—¹not MahApps.Metro.

        /// <inheritdoc cref="GlowWindowBehavior.GlowColor"/>
        [Obsolete($"Use {nameof(GlowColor)}")]
        public Color? GlowBrush
        {
            get => this.GlowColor;
            set => this.GlowColor = value;
        }

Or throw NotImplementedException. I'd prefer that it cause build errors instead of build warnings and runtime errors, but I don't know how to do that. Maybe a custom analyzer that checks for invalid references to GlowBrush and suggests using refactoring to GlowColor.

P.S. The removal of GlowBrush is obviously a breaking change, but breaking changes in transitive dependencies are often overlooked when upgrading explicit dependencies. It's no wonder this became an issue.

¹key-combo'ed em-dash and superscript. They're not LLM-generated.

BinToss added a commit to HaloSPV3/AmaiSosu that referenced this pull request Jul 9, 2026
In transitive dependency `ControlzEx`, the `ControlzEx.WindowChromeWindow.GlowBrush` property was renamed to `GlowColor`...at some point.

See MahApps/MahApps.Metro#4568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

GlowBrush invalid in MetroWindow

2 participants