public EventOfTheDayNodeViewModel(IEventsOfTheDayResult result) { if (result == null) { return; } var @event = result.Event; var image = @event.FirstImage; if (image != null) { Image = image.Thumbnail.Normal; NotifyOfPropertyChanged(() => Image); } Id = @event.Id; Title = @event.Title.GetNormalString(); Description = @event.Description; Categories = ResourcesHelper.GetLocalizationString("EventOfDay"); var dates = @event.DateRange; if (dates == null) { return; } Dates = EventNodeViewModel.GetDates(@event.DateRange); Times = EventNodeViewModel.GetTimes(@event.DateRange); }
public NewsNodeViewModel(INewsListResult result) { if (result == null) { return; } var image = result.Images.FirstOrDefault(); if (image != null) { Image = image.Thumbnail.Normal; } Id = result.Id; Title = result.Title.GetNormalString(); Description = result.Description; if (result.Place != null) { Place = result.Place.Title.GetNormalString(); } if (result.PublicationDate.HasValue) { var format = ResourcesHelper.GetLocalizationString("PublishedAtStringFormat"); Date = string.Format(format, result.PublicationDate.Value.ToString("g")); } }
public SelectionNodeViewModel(ISelectionListResult result, IDataSource dataSource) { if (result == null) { return; } _dataSource = dataSource; Id = result.Id; Title = result.Title.GetNormalString(); if (result.PublicationDate.HasValue) { var format = ResourcesHelper.GetLocalizationString("PublishedAtStringFormat"); Date = string.Format(format, result.PublicationDate.Value.ToString("g")); } }
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(); }); }
public MovieNodeViewModel(IMovieListResult result) { if (result == null) { return; } var poster = result.Images.FirstOrDefault(); if (poster != null) { Poster = poster.Thumbnail.Normal; } Id = result.Id; Title = result.Title.GetNormalString(); Age = result.AgeRestriction; Year = result.Year; Country = result.Country; var format = ResourcesHelper.GetLocalizationString("MinutesStringFormat"); RunningTime = string.Format(format, result.RunningTime); }
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(); }); }