xkillah xkillah - 11 months ago 177
C# Question

PointerPressed not working on left click

Creating Metro (Microsoft UI) app for Windows 8 on WPF+C#, I met difficulty with PointerPressed event on a button. Event doesn't happen when i perform left-click (by mouse), but it happens in case with right-click or tap. So what's wrong with that event?
for example

<Button x:Name="Somebutton" Width="100" Height="100"

Answer Source

The solution is pretty simple: these events have to be handled not through XAML but thorugh AddHandler method.

new PointerEventHandler(SomeButton_PointerPressed), true);