예제 #1
0
        public (FrameworkElement, Size, string) GetViewer(FileInfo fileInfo)
        {
            var requestSize = new Size(572, 290);

            var fileViewer = new GeneficFileViewer();

            fileViewer.BeginInit();
            fileViewer.Thumbnail = ImagingHelper.GetThumbnail(fileInfo.FullName);
            fileViewer.FileInfo  = fileInfo;

            fileViewer.EndInit();

            return(fileViewer, requestSize, null);
        }
        public (FrameworkElement, Size, string) GetViewer(FileInfo fileInfo)
        {
            var requestSize = new Size(600, 300);

            using var tag = TagLib.File.Create(fileInfo.FullName);

            var audioViewer = new AudioFileViewer();

            audioViewer.BeginInit();
            audioViewer.Source    = new Uri(fileInfo.FullName, UriKind.Absolute);
            audioViewer.Thumbnail = ImagingHelper.GetThumbnail(fileInfo.FullName);
            audioViewer.Metadata  = tag.Tag;
            audioViewer.EndInit();

            return(audioViewer, requestSize, WinExplorerHelper.GetSizeFormat(fileInfo.Length));
        }