Minor code imporvment

This commit is contained in:
Stone_Red
2022-05-06 15:32:21 +02:00
parent faec5d20bb
commit ffb13fa0e8
+1 -2
View File
@@ -10,8 +10,7 @@ public class ClipboardManager
public ClipboardManager(Window windowSource) public ClipboardManager(Window windowSource)
{ {
HwndSource? source = PresentationSource.FromVisual(windowSource) as HwndSource; if (PresentationSource.FromVisual(windowSource) is not HwndSource source)
if (source == null)
{ {
throw new ArgumentException( throw new ArgumentException(
"Window source MUST be initialized first, such as in the Window's OnSourceInitialized handler." "Window source MUST be initialized first, such as in the Window's OnSourceInitialized handler."