question

JustHPS-9250 avatar image
0 Votes"
JustHPS-9250 asked JustHPS-9250 answered

Button command execution issue with touch | WPF | MVVM | Windows 10

I am using a simple button in a WPF application running on Windows 10 using MVVM pattern to execute action on click with command binding using touch monitor. What actually happen is sometimes the first time command action is not executing on touch and it is working correctly after second touch onward.

I have verified that the TouchDown and TouchUp event is working correctly all the time (first and onward).

With mouse everything is working well.

The button is present in a Dialog box, I was wondering if it could be associated with any kind of focus management but can't find out ? Please help!

Best regards, HPS.

dotnet-csharpwindows-wpfdotnet-wpf-xaml
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What type of WPF app are you using? (.net framework, .net core 3.1, or .net 5). Could you post some code that shows this issue? TouchDown and TouchUp are routed event type. Routed events will pass the event to everything under the control that is clicked. Is it possible another control is marking the event as handled so it does not make it to the button?

0 Votes 0 ·

@JustHPS-9250
Did you solve your issue? If you didn't, could you provide more detailed info what like vb2ae refered?

0 Votes 0 ·

Finally solved! Please check the answer below.

0 Votes 0 ·

1 Answer

JustHPS-9250 avatar image
1 Vote"
JustHPS-9250 answered

In my case the problem was RealTimeStylus for WPF Applications that should be disabled on Windows 7.

Please check here for details: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/disable-the-realtimestylus-for-wpf-applications?view=netframeworkdesktop-4.8.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.