|
|
@@ -23,6 +23,12 @@ namespace Avalonia.Controls
|
|
|
public static readonly StyledProperty<Stretch> StretchProperty =
|
|
|
AvaloniaProperty.Register<Image, Stretch>(nameof(Stretch), Stretch.Uniform);
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Defines the <see cref="StretchDirection"/> property.
|
|
|
+ /// </summary>
|
|
|
+ public static readonly StyledProperty<StretchDirection> StretchDirectionProperty =
|
|
|
+ AvaloniaProperty.Register<Image, StretchDirection>(nameof(StretchDirection));
|
|
|
+
|
|
|
static Image()
|
|
|
{
|
|
|
AffectsRender<Image>(SourceProperty, StretchProperty);
|
|
|
@@ -43,10 +49,19 @@ namespace Avalonia.Controls
|
|
|
/// </summary>
|
|
|
public Stretch Stretch
|
|
|
{
|
|
|
- get { return (Stretch)GetValue(StretchProperty); }
|
|
|
+ get { return GetValue(StretchProperty); }
|
|
|
set { SetValue(StretchProperty, value); }
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Gets or sets a value controlling in what direction the image will be stretched.
|
|
|
+ /// </summary>
|
|
|
+ public StretchDirection StretchDirection
|
|
|
+ {
|
|
|
+ get { return GetValue(StretchDirectionProperty); }
|
|
|
+ set { SetValue(StretchDirectionProperty, value); }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Renders the control.
|
|
|
/// </summary>
|