public FriendDetailViewModel(User user)
        {
            this.Name = string.Format("{0} {1}", user.firstname, user.lastname);
            this.PhotoUri = user.photo;
            if (user.venue != null)
            {
                string prefix = user.venue.name != "Off the Grid" ? "@ " : string.Empty;
                this.VenueDisplay = prefix + user.venue.name;
                this.LatLong = string.Format("{0}, {1}", user.venue.geolat, user.venue.geolong);
                this.Elapsed = Utilities.GetElapsedText(DateTime.Parse(user.checkin.created).AddHours(-8));
                this.ShowMap = Visibility.Visible;
            }
            else
            {
                this.VenueDisplay = "Off the Grid";
                this.LatLong = string.Empty;
                this.ShowMap = Visibility.Collapsed;

            }

               //user.checkin.

            Items = new ObservableCollection<ItemViewModel>();
            foreach (var item in user.badges)
            {
                Items.Add(new ItemViewModel
                {
                    LineOne = item.name,
                    LineTwo = item.description,
                    PhotoUri = item.icon,
                });
            }
        }
예제 #2
0
        public static bool UserHasCheckInHasVenue(User user)
        {
            if (user == null || user.checkin == null || user.checkin.venue == null)
                return false;

            return true;
        }
예제 #3
0
        public static bool UserHasPhoto(User user)
        {
            if (user == null || string.IsNullOrEmpty(user.photo))
                return false;

            return true;
        }
예제 #4
0
        public static string UserGetPhoto(User user)
        {
            if (user == null || string.IsNullOrEmpty(user.photo))
                return string.Empty;

            return user.photo;
        }
예제 #5
0
        public static bool UserHasBadges(User user)
        {
            if (user == null || user.badges == null || user.badges.Count == 0)
                return false;

            return true;
        }
예제 #6
0
        public static string UserGetId(User user)
        {
            if (user == null || string.IsNullOrEmpty(user.id))
                return string.Empty;

            return user.id;
        }
예제 #7
0
        public static string UserGetLastName(User user)
        {
            if (user == null || string.IsNullOrEmpty(user.lastname))
                return string.Empty;

            return user.lastname;
        }
예제 #8
0
        public static string UserGetEmail(User user)
        {
            if (user == null || string.IsNullOrEmpty(user.email))
                return string.Empty;

            return user.email;
        }
예제 #9
0
        public static string UserGetCheckInGetVenueGetName(User user)
        {
            if (user == null || user.checkin == null || user.checkin.venue == null || string.IsNullOrEmpty(user.checkin.venue.name))
                return string.Empty;

            return user.checkin.venue.name;
        }
예제 #10
0
        public static string UserGetCheckInGetVenueGetAddress(User user)
        {
            if (user == null || user.checkin == null || user.checkin.venue == null || string.IsNullOrEmpty(user.checkin.venue.address))
                return string.Empty;

            return user.checkin.venue.address;
        }
예제 #11
0
        public static Venue UserGetCheckInGetVenue(User user)
        {
            if (user == null || user.checkin == null)
                return null;

            return user.checkin.venue;
        }
예제 #12
0
        public static string UserGetCheckInGetCreatedDate(User user)
        {
            if (user == null || user.checkin == null || string.IsNullOrEmpty(user.checkin.created))
                return string.Empty;

            return user.checkin.created;
        }