public MainPageViewModel() { Images = new List<ImageItem>(); var files = Utilities.GetPictureList(); foreach (var file in files) { if (Utilities.IsValidImageFile(file)) { ImageItem image = new ImageItem(); image.Uri = new Uri(file); image.Name = file.Substring(file.LastIndexOf(@"\") + 1); Images.Add(image); } } }
public MainPageViewModel() { Images = new List <ImageItem>(); var files = Utilities.GetPictureList(); foreach (var file in files) { if (Utilities.IsValidImageFile(file)) { ImageItem image = new ImageItem(); image.Uri = new Uri(file); image.Name = file.Substring(file.LastIndexOf(@"\") + 1); Images.Add(image); } } }
private void LoadPictures(string[] pictures) { Images.Clear(); foreach (var picture in pictures) { if (Utilities.IsValidImageFile(picture)) { ImageItem image = new ImageItem(); image.Uri = new Uri(picture); image.Name = picture.Substring(picture.LastIndexOf(@"\") + 1); Images.Add(image); } } }