Merge branch 'master' into Update-BlurWindow

This commit is contained in:
Mahdi committed 2021-04-25 19:10:38 +04:30
commit 1f0cf4ef91
17 files changed
+100 -79

No files matched your search

@@ -50,6 +50,8 @@ namespace HandyControl.Controls
private bool _showNo;
private IntPtr _lastActiveWindowIntPtr;
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(
"Message", typeof(string), typeof(MessageBox), new PropertyMetadata(default(string)));
@@ -127,6 +129,16 @@ namespace HandyControl.Controls
}
base.OnSourceInitialized(e);
_lastActiveWindowIntPtr = InteropMethods.GetForegroundWindow();
Activate();
}
protected override void OnClosed(EventArgs e)
{
InteropMethods.SetForegroundWindow(_lastActiveWindowIntPtr);
base.OnClosed(e);
}
public override void OnApplyTemplate()