protected override async Task LoadDetails(long id)
        {
            var rs = await _dataSource.GetPlaceDetails(id);

            if (rs == null)
            {
                return;
            }

            LayoutHelper.InvokeFromUiThread(async() =>
            {
                Title       = rs.Title.GetNormalString();
                Description = rs.Description.GetNormalString();
                BodyText    = rs.BodyText.GetNormalString();
                Adress      = rs.Address;
                Phone       = rs.Phone;
                Timetable   = rs.Timetable;
                IsClosed    = rs.IsClosed;

                if (!string.IsNullOrEmpty(rs.SiteUrl))
                {
                    Source = new Uri(rs.SiteUrl);
                }

                foreach (var image in rs.Images)
                {
                    _images.Add(image.Image);
                }

                Metro    = rs.Subway;
                Location = rs.Coords;

                await CommentsViewModel.Load();
            });
        }
示例#2
0
        protected override async Task LoadDetails(long id)
        {
            var rs = await _dataSource.GetSelectionDetails(id);

            if (rs == null)
            {
                return;
            }

            LayoutHelper.InvokeFromUiThread(async() =>
            {
                Title       = rs.Title.GetNormalString();
                Description = rs.Description;

                foreach (var image in rs.Images)
                {
                    _images.Add(image.Image);
                }

                foreach (var item in rs.Items)
                {
                    _selections.Add(new SelectionDetailsNodeViewModel(item, _dataSource));
                }

                await CommentsViewModel.Load();
            });
        }
        protected override async Task LoadDetails(long id)
        {
            var rs = await _dataSource.GetEventDetails(id);

            if (rs == null)
            {
                return;
            }

            LayoutHelper.InvokeFromUiThread(async() =>
            {
                Title       = rs.Title.GetNormalString();
                Description = rs.Description.GetNormalString();
                BodyText    = rs.BodyText.GetNormalString();
                Age         = rs.AgeRestriction;
                IsFree      = rs.IsFree;
                Price       = rs.Price;
                if (!string.IsNullOrEmpty(rs.SiteUrl))
                {
                    Source = new Uri(rs.SiteUrl);
                }

                foreach (var image in rs.Images)
                {
                    _images.Add(image.Image);
                }

                if (rs.Place != null)
                {
                    Place    = rs.Place.Title.GetNormalString();
                    Metro    = rs.Place.Subway;
                    Location = rs.Place.Coords;
                    _placeId = rs.Place.Id;
                }

                var dates = rs.Dates;
                if (dates != null)
                {
                    Dates = EventNodeViewModel.GetDates(dates);
                    Times = EventNodeViewModel.GetTimes(dates);
                }

                await CommentsViewModel.Load();
            });
        }
        protected override async Task LoadDetails(long id)
        {
            var rs = await _dataSource.GetMovieDetails(id);

            if (rs == null)
            {
                return;
            }

            LayoutHelper.InvokeFromUiThread(async() =>
            {
                Title       = rs.Title.GetNormalString();
                Description = rs.Description.GetNormalString();
                BodyText    = rs.BodyText.GetNormalString();

                if (!string.IsNullOrEmpty(rs.SiteUrl))
                {
                    Source = new Uri(rs.SiteUrl);
                }

                foreach (var image in rs.Images)
                {
                    _images.Add(image.Image);
                }


                Age         = rs.AgeRestriction;
                Country     = rs.Country;
                Year        = rs.Year;
                Language    = rs.Language;
                var format  = ResourcesHelper.GetLocalizationString("MinutesStringFormat");
                RunningTime = string.Format(format, rs.RunningTime);
                Trailer     = rs.Trailer;
                Actors      = rs.Stars;
                Url         = rs.Url;
                Director    = rs.Director;

                await CommentsViewModel.Load();
            });
        }
        protected override async Task LoadDetails(long id)
        {
            var rs = await _dataSource.GetNewsDetails(id);

            if (rs == null)
            {
                return;
            }

            LayoutHelper.InvokeFromUiThread(async() =>
            {
                Title       = rs.Title.GetNormalString();
                Description = rs.Description.GetNormalString();
                BodyText    = rs.BodyText.GetNormalString();
                Source      = new Uri(rs.SiteUrl);

                foreach (var image in rs.Images)
                {
                    _images.Add(image.Image);
                }

                //if (rs.Place != null)
                //{
                //    Place = rs.Place.Title.GetNormalString();
                //    Metro = rs.Place.Subway;
                //    Location = rs.Place.Coords;
                //}

                if (rs.PublicationDate.HasValue)
                {
                    var format = ResourcesHelper.GetLocalizationString("PublishedAtStringFormat");
                    Date       = string.Format(format, rs.PublicationDate.Value.ToString("g"));
                }

                await CommentsViewModel.Load();
            });
        }