简体   繁体   中英

Wpf touch events not working in windows 8.1

I have a wpf desktop application. On windows 7 all touch events are working fine, but when I switch to windows 8.1, touch events don't work. Anybody knows why?

Edit

Here is my xaml code:

<Button Content="{Binding DisplayName}" Style="{StaticResource WindowButtonStyle}">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="TouchUp">
            <ei:CallMethodAction TargetObject="{Binding}" MethodName="OnTouchUpMenuButtons"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>
</Button>

and method in the viewModel:

public void OnTouchUpMenuButtons(object sender, TouchEventArgs e)
{
    // code  
}

我已经将TouchUp事件切换为PreviewMouseDown事件,并且可以正常工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM