コード例 #1
0
 protected override void OnNavigatedTo(Microsoft.Phone.Navigation.PhoneNavigationEventArgs e)
 {
     _userId = NavigationContext.QueryString["id"];
     Foursquare.GetUser(GetUserCallback, _userId);
     DataContext = new FriendDetailViewModel();
     base.OnNavigatedTo(e);
 }
コード例 #2
0
 public void GetUserCallback(GetUserCompletedEventArgs e)
 {
     _venue = null;
     if (e.Result.venue != null)
     {
         _venue = e.Result.venue;
         _pinLocation = new Location
             {
                 Latitude = double.Parse(e.Result.venue.geolat),
                 Longitude = double.Parse(e.Result.venue.geolong),
             };
     }
     var model = new FriendDetailViewModel(e.Result);
     DataContext = model;
     if (_pinLocation != null)
     {
         MapHelper.LoadMap(LoadMapCompleted, _pinLocation.Latitude, _pinLocation.Longitude, (int)imageMap.Width,
                           (int)imageMap.Height);
     }
     else
     {
         LayoutRoot.RowDefinitions[2].Height = new GridLength(0);
     }
 }