如何检测在 Windows Phone 7 中选择了 Pivot 项目 [英] How to detect a Pivot item is selected in Windows Phone 7

查看:21
本文介绍了如何检测在 Windows Phone 7 中选择了 Pivot 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Windows Phone 7 中实现 Pivot 控件.

I am implementing the Pivot control in Windows Phone 7.

我想知道在用户执行滑动手势后哪个 Pivot 项被选中并处于活动状态.

I want to know which Pivot item is selected and active after the user does a swipe gesture.

如何检测与Pivot控件相关的滑动手势事件?

How to detect the swipe gesture event related to Pivot control?

我应该使用哪种委托方法?

Which delegate method should I use ?

推荐答案

SelectionChanged 是用于检测 Pivot 项目更改的事件.

SelectionChanged is the event to wire up to for detecting Pivot item changes.

正如 kP 所建议的,SelectedIndex/SelectedItem 是您可以访问以查看当前选择了哪个项目的属性.

As kP suggests, SelectedIndex/SelectedItem are the properties you can access to see which item is currently selected.

这是一个示例事件处理程序,用于在每次更改时显示 SelectedIndex.

Here's an example event handler to show the SelectedIndex each time it changes.

    private void thisPivot_SelectionChanged(object sender, SelectionChangedEventArgs e) {
        System.Diagnostics.Debug.WriteLine(thisPivot.SelectedIndex);
    }

这篇关于如何检测在 Windows Phone 7 中选择了 Pivot 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆