|
|
@@ -49,7 +49,7 @@ namespace InABox.DynamicGrid
|
|
|
return border;
|
|
|
}
|
|
|
|
|
|
- public FrameworkElement? ImageToolTip(BitmapImage? image)
|
|
|
+ public FrameworkElement? ImageToolTip(BitmapImage? image, double? maxWidth = null, double? maxHeight = null)
|
|
|
{
|
|
|
if (image == null)
|
|
|
return null;
|
|
|
@@ -60,7 +60,20 @@ namespace InABox.DynamicGrid
|
|
|
BorderBrush = new SolidColorBrush(Colors.Gray),
|
|
|
BorderThickness = new Thickness(0.75)
|
|
|
};
|
|
|
- result.Child = new Image { Source = image };
|
|
|
+ var imageControl = new Image
|
|
|
+ {
|
|
|
+ Source = image,
|
|
|
+ Stretch = Stretch.Uniform
|
|
|
+ };
|
|
|
+ if (maxWidth.HasValue)
|
|
|
+ {
|
|
|
+ imageControl.MaxWidth = maxWidth.Value;
|
|
|
+ }
|
|
|
+ if (maxHeight.HasValue)
|
|
|
+ {
|
|
|
+ imageControl.MaxHeight = maxHeight.Value;
|
|
|
+ }
|
|
|
+ result.Child = imageControl;
|
|
|
return result;
|
|
|
}
|
|
|
|