コード例 #1
0
 private async Task<PictureViewModel> LoadPictureAsync(string filename)
 {
     PictureViewModel newPicture = PictureViewModel.CreateNew();
     newPicture.Title = Path.GetFileName(filename);
     newPicture.Path = Path.GetFullPath(filename);
     if (this.IsThumbnailRequested)
     {
         await newPicture.LoadThumbnailAsync(filename);
     }
     else
     {
         await newPicture.LoadImageAsync(filename);
     }
     newPicture.CreationDate = File.GetCreationTimeUtc(Path.GetFullPath(filename));
     return newPicture;
 }
コード例 #2
0
        /// <summary>
        /// Creates a new ViewModel.
        /// </summary>
        /// <returns></returns>
        internal static PictureViewModel CreateNew()
        {
            PictureViewModel newViewModel = new PictureViewModel(new Picture());

            return(newViewModel);
        }