如何在打开时加载全景项目

时间:2014-07-16 06:57:12

标签: c# windows-phone-8 panorama-control

在我的wp8应用程序中,我为所有的panoramma项目创建了加载的事件,但是当我运行应用程序时,所有的全景项目都会立即加载,但我希望它们在我轻弹到全景项目时加载

private void podne_Loaded(object sender, RoutedEventArgs e)
{
    tesbihat2.Content = TextToXaml("podne.txt");
}

private void ikindi_Loaded(object sender, RoutedEventArgs e)
{
    tesbihat3.Content = TextToXaml("ikindi.txt");
}

private void aksam_Loaded(object sender, RoutedEventArgs e)
{
    tesbihat4.Content = TextToXaml("aksam.txt");
}

private void jacija_Loaded(object sender, RoutedEventArgs e)
{
    tesbihat5.Content = TextToXaml("jacija.txt");
}

1 个答案:

答案 0 :(得分:1)

试试这个:

private void Panorama_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    switch (((Panorama)sender).SelectedIndex)
    {
        case 0: // defines the first PanoramaItem Loaded
            MessageBox.Show("First Item is on ForeGround");
            break;
        case 1: // second one
            MessageBox.Show("Second Item is on ForeGround");
            break;

        case 2: // third one
            MessageBox.Show("Third Item is on ForeGround");
            break;
    }
}