Windows Phone 8 -我必须双击加载列表框项来检测点击



嘿,伙计们,我的Windows phone 8应用程序中有一个页面,每当我进入该页面时,如果我在ListBox上点击太快,它就不会检测到点击,所以我必须重新点击一两次才能检测到触摸,有时甚至需要多次点击返回按钮(在手机上)。这里是xaml.

 <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <ListBox x:Name="LocationsList" ItemsSource="{Binding Venues}" toolkit:TurnstileFeatherEffect.FeatheringIndex="2" SelectionChanged="LocationsList_SelectionChanged" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Margin="0,0,0,17" Width="432">
                        <TextBlock Text="{Binding Name}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                        <TextBlock Text="{Binding Address}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextAccentStyle}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
    </Grid>

尝试使用Tap属性和LongListSelector

xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
<phone:LongListSelector Tap="OnSeleted">

不确定回车键。在重写的函数中放置一个断点,以确保每次按一次返回键时都调用该函数:

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
   base.OnBackKeyPress(e);
}

最新更新