1

我有一个简单的应用程序,上面有两页。第一页正常运行,我在页面上有一个导航到第二页的按钮。

但是,当我到达第二页时,每当我尝试触摸任何东西时,都会OnTouch触发事件并ArgumentExceptionListDictionaryInternal

但是,页面上没有与此 OnTouch 事件交互的任何内容,因此我不确定是什么原因造成的。

导航到新页面的代码:

string page = "valid";
NavigationService.Navigate(
    new Uri("/Dialog.xaml?page=" + page,
    UriKind.Relative)
);

崩溃页面的 XAML 非常简单:

<Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel Grid.Row="0" Margin="12,17,0,28">
        <TextBlock Name="AppName" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock Name="PageName" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <Button Click="CancelDownload_Click" Opacity="1.0" Content="Cancel REST Request!" Background="Blue" Foreground="White" BorderBrush="Black" FontWeight="Bold" BorderThickness="1" x:Name="CancelData" VerticalAlignment="Center" Margin="90,327,90,291" Height="150" Width="300" Visibility="Collapsed" />
    </Grid>
</Grid>

什么可能导致 OnTouch 以这种方式失败?

感谢您的任何帮助。

4

1 回答 1

0

事实证明,你是我在与嵌套全景图交互时用来禁用 PivotItems 滚动的主页中的一个黑客。

导致错误的代码:

Touch.FrameReported += (s, e) =>
{
    if (e.GetPrimaryTouchPoint(MainItems).Action == TouchAction.Up)
    {
        MainItems.IsHitTestVisible = true;
    }
};
于 2013-01-16T16:55:30.677 回答