MahApps.Metro icon indicating copy to clipboard operation
MahApps.Metro copied to clipboard

Drop shadow is not blinking after focus lost for modal dialogs

Open maheshniec opened this issue 11 years ago • 2 comments

Though EnabledDWMDropShadow is made true, drop shadow will not be blinked after losing the focus from application for modal dialogs.

maheshniec avatar Feb 24 '15 12:02 maheshniec

I noticed that the MetroWindow frame doesn't blink either, whereas the sound does play. After hooking into the window message loop for a normal WPF window I got the following table:

msg wParam lParam
134 0 0
134 1 0
127 1 0
127 2 0
127 0 0
127 1 0
127 2 0
127 0 0
134 0 0
134 1 0

with the last two rows repeating themselves six times, making fourteen 134 messages total. The 134 message is the WM_NCACTIVATE message (wParam: 0 = inactive, 1 = active) and the 127 one is the WM_GETICON message (which I think isn't as important here).

Maybe the blink feature can be implemented by listening to these messages, but I don't have enough knowledge right now about the MetroWindow components and behaviors to write a solution for this.

Dotnetifier avatar Jul 28 '15 13:07 Dotnetifier

This is now available in latest source and will be released with the next version (v2.0).

So you can bind to the WindowChromeBehavior property and handle this by yourself.

var behavior = new WindowChromeBehavior();

//...

this.SetBinding(IsNCActiveProperty, new Binding { Path = new PropertyPath(WindowChromeBehavior.IsNCActiveProperty), Source = behavior });

Interaction.GetBehaviors(this).Add(behavior);

punker76 avatar Oct 31 '19 15:10 punker76