PageRenderTime 59ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 0ms

/samples/Microsoft.AspNet.SignalR.Client.WP7.Sample/DetailsPage.xaml.cs

https://github.com/mip1983/SignalR
C# | 36 lines | 32 code | 2 blank | 2 comment | 1 complexity | 1b53f4bca375af9c2533f9b050e466fd MD5 | raw file
Possible License(s): Apache-2.0, CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Documents;
  8. using System.Windows.Input;
  9. using System.Windows.Media;
  10. using System.Windows.Media.Animation;
  11. using System.Windows.Shapes;
  12. using System.Windows.Navigation;
  13. using Microsoft.Phone.Controls;
  14. namespace Microsoft.AspNet.SignalR.Client.WP7.Sample
  15. {
  16. public partial class DetailsPage : PhoneApplicationPage
  17. {
  18. // Constructor
  19. public DetailsPage()
  20. {
  21. InitializeComponent();
  22. }
  23. // When page is navigated to set data context to selected item in list
  24. protected override void OnNavigatedTo(NavigationEventArgs e)
  25. {
  26. string selectedIndex = "";
  27. if (NavigationContext.QueryString.TryGetValue("selectedItem", out selectedIndex))
  28. {
  29. int index = int.Parse(selectedIndex);
  30. DataContext = App.ViewModel.Items[index];
  31. }
  32. }
  33. }
  34. }