Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 单击wp8.1中边框下的按钮_Wpf_Xaml_Windows Phone 8_Windows Runtime - Fatal编程技术网

Wpf 单击wp8.1中边框下的按钮

Wpf 单击wp8.1中边框下的按钮,wpf,xaml,windows-phone-8,windows-runtime,Wpf,Xaml,Windows Phone 8,Windows Runtime,是否可以单击边界覆盖的按钮? 如果是,如何处理发生的事件 这是页面布局: <Page x:Class="App6.MainPage" <!-- ... --> > <Grid> <Button Content="click" /> <Border Background="Transparent" /> </Grid> </Page> 多亏了我找到

是否可以单击边界覆盖的
按钮
? 如果是,如何处理发生的事件

这是页面布局:

<Page x:Class="App6.MainPage" 
    <!-- ... -->
    >
    <Grid>
        <Button Content="click" />
        <Border Background="Transparent" />
    </Grid>
</Page>
多亏了我找到了解决这个问题的方法。
只需在
true
中添加处理程序并设置参数
handleEventsToo

public MainPage()
{
    this.InitializeComponent();
    this.Button.AddHandler(PointerPressedEvent, new PointerEventHandler(pointerPressedEvent), true);
}

private void pointerPressedEvent(object sender, PointerRoutedEventArgs e)
{

}
之后,您可以在单击按钮后看到UI回调