public FriendInfoViewModel() { Friend = StaticClasses.StaticFriend; Positions = new ObservableCollection<Position>(); Positions.CollectionChanged += Positions_CollectionChanged; DownloadedError = false; PositionsToBeDownloaded = 35; }
static Permission GetPermission(Friend selectedFriend) { Permission per = new Permission(); per.FBIDFromViewed = selectedFriend.FBIDFromViewed; per.FBIDFromViewer = selectedFriend.FBIDFromViewer; per.IsAllowed = !selectedFriend.IsAllowed; per.PartitionKey = per.FBIDFromViewer; per.RowKey = per.FBIDFromViewed; return per; }
private void FriendInfoView_Loaded(object sender, RoutedEventArgs e) { Friend = ((FriendInfoViewModel)this.DataContext).Friend; ((FriendInfoViewModel)this.DataContext).DownloadLastPositions(35); image = new BitmapImage(); image.UriSource = (new Uri(Friend.Picture, UriKind.Absolute)); lstPositions.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged; myMap.ZoomLevel = 18; myMap.Center = new GeoCoordinate(Friend.LastPosition.Latitude, Friend.LastPosition.Longitude); }
private void FriendInfoView_Loaded(object sender, RoutedEventArgs e) { SelectedFriend = ((FriendInfoViewModel)this.DataContext).Friend; ((FriendInfoViewModel)this.DataContext).DownloadLastPositions(50); image = new BitmapImage(); image.UriSource = (new Uri(SelectedFriend.Picture, UriKind.Absolute)); pageTitle.Text = "Ultimas posiciones de " + SelectedFriend.Name; myMap.Center = new Location(SelectedFriend.LastPosition.Latitude, SelectedFriend.LastPosition.Longitude); myMap.ZoomLevel = 15; lstPositions.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged; }
private static void SetSharingContent(Friend selectedFriend) { Share.Title = "SmartGuard - " + selectedFriend.Name; Share.Description = "Comparte la posicion de tus amigos"; DateTime date = selectedFriend.LastPosition.RegisteredAt; Share.Message = String.Format(AppResources.FacebookMessageFriendPost, selectedFriend.Name, selectedFriend.LastPosition.Address, date.Date.ToString(), date.TimeOfDay.ToString(), "http://bing.com/maps/default.aspx" + "?cp=" + selectedFriend.LastPosition.Latitude + "~" + selectedFriend.LastPosition.Longitude + "&lvl=18" + "&style=r"); }