优化代码
This commit is contained in:
@@ -25,8 +25,7 @@ namespace Ink_Canvas.Helpers
|
||||
return Screen.PrimaryScreen;
|
||||
|
||||
// 获取窗口的句柄
|
||||
var hwndSource = PresentationSource.FromVisual(window) as HwndSource;
|
||||
if (hwndSource == null)
|
||||
if (!(PresentationSource.FromVisual(window) is HwndSource hwndSource))
|
||||
return Screen.PrimaryScreen;
|
||||
|
||||
// 获取窗口在屏幕上的位置
|
||||
|
||||
Reference in New Issue
Block a user