2017-04-05 9 views
1

WPFでは、以下のようにApp.xaml.csに登録することで、グローバルマウスイベントを取得できます。UWPのグローバルイベント

EventManager.RegisterClassHandler(typeof(Window), Window.PreviewMouseDownEvent, new MouseButtonEventHandler(OnPreviewMouseDown)); 
EventManager.RegisterClassHandler(typeof(Window), Window.PreviewMouseUpEvent, new MouseButtonEventHandler(OnPreviewMouseUp)); 
EventManager.RegisterClassHandler(typeof(Window), Window.PreviewKeyDownEvent, new KeyEventHandler(OnKeyDownEvent)); 

UWPでは、アプリケーションのApp.xaml.csからPointerMovedイベントをどのように取得できるのでしょうか。

答えて

2

あなたは提供シングルトンクラスでのメインウィンドウのコンテンツにアクセスすることができます

Window.Current.Content.PointerPressed += OnPointerPressed; 
Window.Current.Content.Pointer... // etc... 
+0

ありがとうございました。それは良いです。 – ceastgun

関連する問題