如何以编程方式切换到不同的 PanoramaItem?

发布于 2024-10-20 09:10:21 字数 347 浏览 2 评论 0原文

注意:我已经看到这个,但它没有不回答问题。

我的应用程序有首次运行体验,它向用户提供了一些不同的选项来解释应用程序的功能。如果他们选择其中一个选项,我想向他们展示处理该特定功能的 PanoramaItem。它恰好是项目#3。

因此,Panorama.SelectedItem 是只读的。还有其他方法吗?如果没有,我可以通过模拟一些手势输入来伪造它吗?一个人会怎样做呢?

Note: I already saw this and it doesn't answer the question.

I have a first run experience for my app that presents the user with a few different options explaining what the app does. If they select one of those options, I want to show them the PanoramaItem that deals with that particular functionality. It happens to be item #3.

So, Panorama.SelectedItem is read-only. Is there some other way to do it? If not, could I fake it by, say, simulating some gesture input? How would one do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅笑轻吟梦一曲 2024-10-27 09:10:21

由于 SelectedItemSelectedIndex 当前处于 private set 规则下,因此您实际上无法通过应用程序修改它们。但是,您可以更改 DefaultItem 属性:

<PANORAMA_CONTROL>.DefaultItem = <PANORAMA_CONTROL>.Items[1];

这会导致项目稍微重新排列,因为您将项目设置为列表中的第一个项目,但除此之外,这是一种可接受的方式这样做,因为它实际上会将项目带到用户面前。

Since SelectedItem and SelectedIndex are currently under the private set rule, indeed you cannot modify them through the application. However, you can change the DefaultItem property:

<PANORAMA_CONTROL>.DefaultItem = <PANORAMA_CONTROL>.Items[1];

It will cause items to be a bit re-arranged since you are setting an item to be the first in the list, but other than that it is an acceptable way to do this, since it will actually bring the item in front of the user.

机场等船 2024-10-27 09:10:21

您可以更改默认项。

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        string selected = String.Empty;

        //check to see if the selected parameter was passed.
        if (NavigationContext.QueryString.ContainsKey("selected"))
        {
            //get the selected parameter off the query string from MainPage.
            selected = NavigationContext.QueryString["selected"];
        }

        //did the querystring indicate we should go to item2 instead of item1?
        if (selected == "item2")
        {
            //item2 is the second item, but 0 indexed. 
            myPanorama.DefaultItem = myPanorama.Items[1];
        }
        base.OnNavigatedTo(e);
    }

这是我为不同目的制作的一个示例,但它具有此功能。 http://dl.dropbox.com/u/129101/Panorama_querystring.zip

You can change the DefaultItem.

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        string selected = String.Empty;

        //check to see if the selected parameter was passed.
        if (NavigationContext.QueryString.ContainsKey("selected"))
        {
            //get the selected parameter off the query string from MainPage.
            selected = NavigationContext.QueryString["selected"];
        }

        //did the querystring indicate we should go to item2 instead of item1?
        if (selected == "item2")
        {
            //item2 is the second item, but 0 indexed. 
            myPanorama.DefaultItem = myPanorama.Items[1];
        }
        base.OnNavigatedTo(e);
    }

Here's an example I made for a different purpose but it has this functionality. http://dl.dropbox.com/u/129101/Panorama_querystring.zip

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文