Search found 4 matches

by Wegel
07 Apr 2019, 17:01
Forum: General Discussion
Replies: 2
Views: 3178

Re: Getting mouse position in MouseDown event

I think I found the culprit. In the version that binds the event from ConnectEvent, the handling function is marked as async, and I was doing something similar to: async void OnMouseDownMyUserControl(object sender, MouseButtonEventArgs args) { await doSomeAsyncStuff(); var _offset = args.GetPosition...
by Wegel
07 Apr 2019, 03:18
Forum: General Discussion
Replies: 2
Views: 3178

Getting mouse position in MouseDown event

Hi, I have a very simple UserControl on which I apply MouseDown="OnMouseDownMyUserControl" in the XAML, and in the ConnectEvent of my root code-behind: if (eventName == "MouseDown" && handlerName == "OnMouseDownMyUserControl"){ ((MyUserControl)source).MouseDown ...
by Wegel
05 Apr 2019, 01:36
Forum: General Discussion
Replies: 3
Views: 3348

Re: Global Keyboard handling

Do you think that could work for you?
Yes sir, works perfectly! Thanks for the code snippet, much appreciated :)
by Wegel
04 Apr 2019, 16:21
Forum: General Discussion
Replies: 3
Views: 3348

Global Keyboard handling

Hi, How can I handle keyboard events globally, without needed a specific element to be focused? My root element is currently a Page, and it contains a Grid; both have a Background defined. However I cannot seem to receive the KeyDown/KeyUp events on those (either when using a KeyUp definition in the...