private void ShowImageMediaSources(object parameters) { RefreshMediaFiles(parameters); IEnumerable <MediaFile> query = MediaFiles.Where(mf => mf.Type == CommonElements.Enums.MediaType.Image).OrderBy(mf => mf.Name); List <MediaFile> result = query.ToList <MediaFile>(); MediaFiles.Clear(); foreach (MediaFile r in result) { MediaFiles.Add(r); } }
/// <summary> /// Gets the type of the image by photo. /// </summary> /// <param name="type">The type.</param> /// <returns></returns> public MediaFile GetImageByPhotoType(PhotoType type) { MediaFile mediaFile = new MediaFile(); foreach (MediaFile file in MediaFiles.Where(file => file.PhotoType == type)) { mediaFile = file; break; } return(mediaFile); }