public void AddPic(Picture picture) { var pic = new PictureVM { Id = picture.Id, MSource = PictureExtensions.ImagePath(picture.Id + picture.Extension, "m", picture.Created), SSource = PictureExtensions.ImagePath(picture.Id + picture.Extension, "s", picture.Created), }; Pics.Add(pic); }
public void SavePicture(string Id) { if (!string.IsNullOrEmpty(Id)) { var pic = new PictureVM { Id = Guid.Parse(Id), MSource = PictureExtensions.ImagePath(Id + ".jpg", "m", DateTime.Now), SSource = PictureExtensions.ImagePath(Id + ".jpg", "s", DateTime.Now), }; Pics.Add(pic); } }
//protected override async Task OnInitializedAsync() //{ //} protected override async Task OnParametersSetAsync() { Id = Id ?? "1"; Article = await ArticleService.GetAsync(int.Parse(Id)); foreach (var picture in Article.Pictures) { var pic = new PictureVM { Id = picture.Id, MSource = PictureExtensions.ImagePath(picture.Id + picture.Extension, "m", picture.Created), NSource = PictureExtensions.ImagePath(picture.Id + picture.Extension, "n", picture.Created), Active = "" }; Pics.Add(pic); } if (Pics.Count > 0) { Pics.First().Active = "active"; } }
public void AddTooltipInfo(string url, string tooltip, Image img) { TooltipText.Add(new KeyValuePair <string, string>(url, tooltip)); Pics.Add(new KeyValuePair <string, Image>(url, img)); }