// When the user enters a listbox item, show the image private void Row_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) { if (!(sender is DataGridRow dgr)) { return; } if (dgr?.Item == null) { return; } Tuple <string, string, bool> tuple = (Tuple <string, string, bool>)dgr.Item; string path = Path.Combine(this.FolderPath, tuple.Item1); Image image = new Image() { Source = Util.FilesFolders.GetFileTypeByItsExtension(path) == FileExtensionEnum.IsImage ? BitmapUtilities.GetBitmapFromImageFile(path, Constant.ImageValues.PreviewWidth480, ImageDisplayIntentEnum.Ephemeral, ImageDimensionEnum.UseWidth, out _) : BitmapUtilities.GetBitmapFromVideoFile(path, Constant.ImageValues.PreviewWidth480, ImageDisplayIntentEnum.Ephemeral, ImageDimensionEnum.UseWidth, out _), HorizontalAlignment = HorizontalAlignment.Left }; dgr.ToolTip = image; }
// Get the bitmap representing a video file public override BitmapSource LoadBitmap(string imageFolderPath, Nullable <int> desiredWidthOrHeight, ImageDisplayIntentEnum displayIntent, ImageDimensionEnum imageDimension, out bool isCorruptOrMissing) { // Invoke the static version. The only change is that we get the full file path and pass that as a parameter return(BitmapUtilities.GetBitmapFromVideoFile(this.GetFilePath(imageFolderPath), desiredWidthOrHeight, displayIntent, imageDimension, out isCorruptOrMissing)); }