public (FrameworkElement, Size, string) GetViewer(FileInfo fileInfo)
        {
            if (!TryGetVideoSize(fileInfo.FullName, out var requestSize))
            {
                requestSize = new Size();
            }

            var videoViewer = new VideoFileViewer();

            videoViewer.BeginInit();
            videoViewer.Source = new Uri(fileInfo.FullName, UriKind.Absolute);
            videoViewer.EndInit();

            return(videoViewer, requestSize, FormatMetadata(requestSize, fileInfo));
        }
예제 #2
0
        public override FrameworkElement GetElement(string fileName)
        {
            var maxWidth  = SystemParameters.WorkArea.Width - 100;
            var maxHeight = SystemParameters.WorkArea.Height - 100;

            var videoViewer = new VideoFileViewer();

            videoViewer.BeginInit();
            videoViewer.Source = new Uri(fileName, UriKind.Absolute);
            videoViewer.Width  = maxWidth / 2;
            videoViewer.Height = maxHeight / 2;
            videoViewer.EndInit();

            return(videoViewer);
        }