【问题标题】:Refresh Data of Windows Phone Panorama Item刷新 Windows Phone 全景项目的数据
【发布时间】:2013-09-19 03:53:33
【问题描述】:

我正在使用全景页面开发 Windows Phone 8 应用程序。 我的页面中有大约 5-6 个全景项目供用户滚动。

目前我正在加载全景页面时绑定这些页面的数据。我的一些全景项目从 Web 服务获取数据。对于这些页面,我只想在用户滚动到该项目时获取数据。

我怎样才能做到这一点??

【问题讨论】:

    标签: windows-phone-8 windows-phone


    【解决方案1】:

    为 Panorama 的 SelectionChanged 事件添加处理程序并检查 Panorama 的 SelectedIndexSelectedItem 属性以确定是否选择了所需的 PanoramaItem。

    XAML

    <phone:Panorama x:Name="myPanorama" Title="my application" SelectionChanged="Panorama_SelectionChanged">
    
        <!--Panorama item one-->
        <phone:PanoramaItem Header="item1">
            <Grid/>
        </phone:PanoramaItem>
    
        <!--Panorama item two-->
        <phone:PanoramaItem Header="item2">
            <Grid/>
        </phone:PanoramaItem>
    </phone:Panorama>
    

    代码背后

    private void Panorama_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (myPanorama.SelectedIndex == 2)
        {
            // Take on-demand actions
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 2012-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多