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

@@ -218,7 +218,12 @@ namespace HandyControl.Controls
#region Calc AvailableSize
_childGraph.Reset(false);
var boundingSize = _childGraph.GetBoundingSize(Width.IsNaN(), Height.IsNaN());
var calcWidth = Width.IsNaN() && HorizontalAlignment != HorizontalAlignment.Stretch;
var calcHeight = Height.IsNaN() && VerticalAlignment != VerticalAlignment.Stretch;
var boundingSize = _childGraph.GetBoundingSize(calcWidth, calcHeight);
_childGraph.Reset();
_childGraph.Measure(boundingSize);
return boundingSize;
@@ -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()