所以我有listitems,當我點擊一個項目,我必須導航到一個新的頁面(非全景圖)。像標準的數據綁定應用程序一樣。我有複製粘貼代碼像一個數據綁定應用程序,不做我想要的。如何瀏覽全景圖頁面和新頁面(非全景圖)
這是我的xaml全景圖頁。
<controls:PanoramaItem x:Name="deeln" Header="Deelnemers" Style="{StaticResource subtitle}">
<!--Double line list with image placeholder and text wrapping-->
<ListBox Margin="12,0,-12,0" ItemsSource="{Binding ItemsDeelnemer}" x:Name="lbDeelnemer" SelectionChanged="lbDeelnemer_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled">
<StackPanel Orientation="Horizontal" Margin="0,0,0,17">
<TextBlock Foreground="Black" TextWrapping="Wrap" Text="{Binding LineNr}" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="35" ></TextBlock>
<StackPanel Width="430" Height="100">
<TextBlock Foreground="Black" TextWrapping="Wrap" Text="{Binding LineNaamWielrenner1}" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="35"></TextBlock>
<TextBlock Foreground="Black" TextWrapping="Wrap" Text="{Binding LineNaamWielrenner2}" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="35"></TextBlock>
</StackPanel>
</StackPanel>
</ScrollViewer>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</controls:PanoramaItem>
這是我的代碼全景圖頁。
private void lbDeelnemer_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
#region go to specific deelnemerinfo screen
// int indexer = lbDeelnemer.SelectedIndex;
// If selected index is -1 (no selection) do nothing
if (lbDeelnemer.SelectedIndex == -1)
return;
// Navigate to the new page
NavigationService.Navigate(new Uri("/DeelnemerInfo.xaml", UriKind.Relative));
//NavigationService.Navigate(new Uri("/DeelnemerInfo.xaml?selectedItem=" + lbDeelnemer.SelectedIndex, UriKind.Relative));
// Reset selected index to -1 (no selection)
lbDeelnemer.SelectedIndex = -1;
#endregion
}
注意:/DeelnemerInfo.xaml是新頁面(非全景頁面),只是一個基本的人像頁面。 幫幫我!
你想傳遞參數到一個新的頁面,我很抱歉,但我不明白是什麼問題? – Alexandr 2013-04-09 19:54:39
如果你在lbDeelnemer_SelectionChanged中放置了一個斷點,它會被提升嗎?當您更改列表框中的選擇時實際發生了什麼? – 2013-04-09 20:09:22
沒有它沒有提出,我已經檢查,但不知道如何修復.. – 2013-04-10 10:25:43