Browse Source

Fix for 1118

Nikita Tsukanov 8 years ago
parent
commit
db63b74aaa

+ 3 - 3
src/Avalonia.Visuals/Media/GradientBrush.cs

@@ -21,8 +21,8 @@ namespace Avalonia.Media
         /// <summary>
         /// Defines the <see cref="GradientStops"/> property.
         /// </summary>
-        public static readonly StyledProperty<IReadOnlyList<GradientStop>> GradientStopsProperty =
-            AvaloniaProperty.Register<GradientBrush, IReadOnlyList<GradientStop>>(nameof(Opacity));
+        public static readonly StyledProperty<IList<GradientStop>> GradientStopsProperty =
+            AvaloniaProperty.Register<GradientBrush, IList<GradientStop>>(nameof(Opacity));
 
         /// <summary>
         /// Initializes a new instance of the <see cref="GradientBrush"/> class.
@@ -46,7 +46,7 @@ namespace Avalonia.Media
         /// Gets or sets the brush's gradient stops.
         /// </summary>
         [Content]
-        public IReadOnlyList<GradientStop> GradientStops
+        public IList<GradientStop> GradientStops
         {
             get { return GetValue(GradientStopsProperty); }
             set { SetValue(GradientStopsProperty, value); }

+ 1 - 1
src/Avalonia.Visuals/Media/IGradientBrush.cs

@@ -10,7 +10,7 @@ namespace Avalonia.Media
         /// <summary>
         /// Gets the brush's gradient stops.
         /// </summary>
-        IReadOnlyList<GradientStop> GradientStops { get; }
+        IList<GradientStop> GradientStops { get; }
 
         /// <summary>
         /// Gets the brush's spread method that defines how to draw a gradient that doesn't fill

+ 2 - 2
src/Avalonia.Visuals/Media/Immutable/ImmutableGradientBrush.cs

@@ -16,7 +16,7 @@ namespace Avalonia.Media.Immutable
         /// <param name="opacity">The opacity of the brush.</param>
         /// <param name="spreadMethod">The spread method.</param>
         protected ImmutableGradientBrush(
-            IReadOnlyList<GradientStop> gradientStops,
+            IList<GradientStop> gradientStops,
             double opacity,
             GradientSpreadMethod spreadMethod)
         {
@@ -36,7 +36,7 @@ namespace Avalonia.Media.Immutable
         }
 
         /// <inheritdoc/>
-        public IReadOnlyList<GradientStop> GradientStops { get; }
+        public IList<GradientStop> GradientStops { get; }
 
         /// <inheritdoc/>
         public double Opacity { get; }

+ 1 - 1
src/Avalonia.Visuals/Media/Immutable/ImmutableLinearGradientBrush.cs

@@ -20,7 +20,7 @@ namespace Avalonia.Media.Immutable
         /// <param name="startPoint">The start point for the gradient.</param>
         /// <param name="endPoint">The end point for the gradient.</param>
         public ImmutableLinearGradientBrush(
-            IReadOnlyList<GradientStop> gradientStops,
+            IList<GradientStop> gradientStops,
             double opacity = 1,
             GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
             RelativePoint? startPoint = null,

+ 1 - 1
src/Avalonia.Visuals/Media/Immutable/ImmutableRadialGradientBrush.cs

@@ -22,7 +22,7 @@ namespace Avalonia.Media.Immutable
         /// The horizontal and vertical radius of the outermost circle of the radial gradient.
         /// </param>
         public ImmutableRadialGradientBrush(
-            IReadOnlyList<GradientStop> gradientStops,
+            IList<GradientStop> gradientStops,
             double opacity = 1,
             GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad,
             RelativePoint? center = null,