update PushMainWindow2TopCommand

This commit is contained in:
NaBian committed 2020-08-28 00:00:50 +08:00
1 parent 7151fec7b8
commit 652bdf918e
2 files changed
+4 -11

No files matched your search

@@ -1,8 +1,7 @@
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using HandyControl.Tools.Interop;
using HandyControl.Tools;
namespace HandyControl.Interactivity
{
@@ -15,11 +14,7 @@ namespace HandyControl.Interactivity
if (Application.Current.MainWindow != null && Application.Current.MainWindow.Visibility != Visibility.Visible)
{
Application.Current.MainWindow.Show();
var hwndSource = (HwndSource)PresentationSource.FromDependencyObject(Application.Current.MainWindow);
if (hwndSource != null)
{
InteropMethods.SetForegroundWindow(hwndSource.Handle);
}
WindowHelper.SetWindowToForeground(Application.Current.MainWindow);
}
}