diff --git a/src/Avalonia.Controls/Border.cs b/src/Avalonia.Controls/Border.cs
index 78ba23c1dd..3c0802c013 100644
--- a/src/Avalonia.Controls/Border.cs
+++ b/src/Avalonia.Controls/Border.cs
@@ -50,24 +50,28 @@ namespace Avalonia.Controls
///
/// Defines the property.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public static readonly StyledProperty BorderDashOffsetProperty =
AvaloniaProperty.Register(nameof(BorderDashOffset));
///
/// Defines the property.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public static readonly StyledProperty?> BorderDashArrayProperty =
AvaloniaProperty.Register?>(nameof(BorderDashArray));
///
/// Defines the property.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public static readonly StyledProperty BorderLineCapProperty =
AvaloniaProperty.Register(nameof(BorderLineCap), PenLineCap.Flat);
///
/// Defines the property.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public static readonly StyledProperty BorderLineJoinProperty =
AvaloniaProperty.Register(nameof(BorderLineJoin), PenLineJoin.Miter);
@@ -86,10 +90,6 @@ namespace Avalonia.Controls
BorderBrushProperty,
BorderThicknessProperty,
CornerRadiusProperty,
- BorderDashArrayProperty,
- BorderLineCapProperty,
- BorderLineJoinProperty,
- BorderDashOffsetProperty,
BoxShadowProperty);
AffectsMeasure(BorderThicknessProperty);
}
@@ -115,8 +115,8 @@ namespace Avalonia.Controls
///
public IBrush? Background
{
- get { return GetValue(BackgroundProperty); }
- set { SetValue(BackgroundProperty, value); }
+ get => GetValue(BackgroundProperty);
+ set => SetValue(BackgroundProperty, value);
}
///
@@ -124,17 +124,18 @@ namespace Avalonia.Controls
///
public IBrush? BorderBrush
{
- get { return GetValue(BorderBrushProperty); }
- set { SetValue(BorderBrushProperty, value); }
+ get => GetValue(BorderBrushProperty);
+ set => SetValue(BorderBrushProperty, value);
}
///
/// Gets or sets a collection of values that indicate the pattern of dashes and gaps that is used to outline shapes.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public AvaloniaList? BorderDashArray
{
- get { return GetValue(BorderDashArrayProperty); }
- set { SetValue(BorderDashArrayProperty, value); }
+ get => GetValue(BorderDashArrayProperty);
+ set => SetValue(BorderDashArrayProperty, value);
}
///
@@ -142,35 +143,38 @@ namespace Avalonia.Controls
///
public Thickness BorderThickness
{
- get { return GetValue(BorderThicknessProperty); }
- set { SetValue(BorderThicknessProperty, value); }
+ get => GetValue(BorderThicknessProperty);
+ set => SetValue(BorderThicknessProperty, value);
}
///
/// Gets or sets a value that specifies the distance within the dash pattern where a dash begins.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public double BorderDashOffset
{
- get { return GetValue(BorderDashOffsetProperty); }
- set { SetValue(BorderDashOffsetProperty, value); }
+ get => GetValue(BorderDashOffsetProperty);
+ set => SetValue(BorderDashOffsetProperty, value);
}
///
/// Gets or sets a enumeration value that describes the shape at the ends of a line.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public PenLineCap BorderLineCap
{
- get { return GetValue(BorderLineCapProperty); }
- set { SetValue(BorderLineCapProperty, value); }
+ get => GetValue(BorderLineCapProperty);
+ set => SetValue(BorderLineCapProperty, value);
}
///
/// Gets or sets a enumeration value that specifies the type of join that is used at the vertices of a Shape.
///
+ [Obsolete("Dashed lines on Border are no longer supported. Use Shapes directly instead.")]
public PenLineJoin BorderLineJoin
{
- get { return GetValue(BorderLineJoinProperty); }
- set { SetValue(BorderLineJoinProperty, value); }
+ get => GetValue(BorderLineJoinProperty);
+ set => SetValue(BorderLineJoinProperty, value);
}
///
@@ -178,8 +182,8 @@ namespace Avalonia.Controls
///
public CornerRadius CornerRadius
{
- get { return GetValue(CornerRadiusProperty); }
- set { SetValue(CornerRadiusProperty, value); }
+ get => GetValue(CornerRadiusProperty);
+ set => SetValue(CornerRadiusProperty, value);
}
///
@@ -227,8 +231,14 @@ namespace Avalonia.Controls
/// The drawing context.
public sealed override void Render(DrawingContext context)
{
- _borderRenderHelper.Render(context, Bounds.Size, LayoutThickness, CornerRadius, Background, BorderBrush,
- BoxShadow, BorderDashOffset, BorderLineCap, BorderLineJoin, BorderDashArray);
+ _borderRenderHelper.Render(
+ context,
+ Bounds.Size,
+ LayoutThickness,
+ CornerRadius,
+ Background,
+ BorderBrush,
+ BoxShadow);
}
///