diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/BarChart/BitChartBarScales.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/BarChart/BitChartBarScales.cs index 18da6bec34..8ea9436062 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/BarChart/BitChartBarScales.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/BarChart/BitChartBarScales.cs @@ -12,12 +12,12 @@ public class BitChartBarScales /// You can use any but there are extended axes in the namespace which contain additional properties to customize the bar chart axes. /// [JsonProperty("xAxes")] - public IList XAxes { get; set; } + public List XAxes { get; set; } /// /// Gets or sets the configurations for the y-axes. /// You can use any but there are extended axes in the namespace which contain additional properties to customize the bar chart axes. /// [JsonProperty("yAxes")] - public IList YAxes { get; set; } + public List YAxes { get; set; } } diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/Axes/Ticks/BitChartCategoryTicks.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/Axes/Ticks/BitChartCategoryTicks.cs index 90de4dd044..954752c798 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/Axes/Ticks/BitChartCategoryTicks.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/Axes/Ticks/BitChartCategoryTicks.cs @@ -8,7 +8,7 @@ public class BitChartCategoryTicks : BitChartCartesianTicks /// /// Gets or sets an array of labels to display. /// - public IList Labels { get; set; } + public List Labels { get; set; } /// /// Gets or sets the minimum item to display. The item has to be present in . diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartChartData.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartChartData.cs index 2b60ee5278..2e8db578e4 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartChartData.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartChartData.cs @@ -23,7 +23,7 @@ public BitChartChartData() /// for the chart to work correctly. /// /// - public virtual IList Labels { get; } + public virtual List Labels { get; } /// /// Gets the labels the horizontal axes will use. @@ -32,7 +32,7 @@ public BitChartChartData() /// for the chart to work correctly. /// /// - public virtual IList XLabels { get; } + public virtual List XLabels { get; } /// /// Gets the labels the vertical axes will use. @@ -41,12 +41,12 @@ public BitChartChartData() /// for the chart to work correctly. /// /// - public virtual IList YLabels { get; } + public virtual List YLabels { get; } /// /// Gets the datasets displayed in this chart. /// - public IList Datasets { get; } + public List Datasets { get; } [Obsolete("json.net", true)] public bool ShouldSerializeLabels() => Labels?.Count > 0; diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartConfigBase.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartConfigBase.cs index 96b670438e..17ba6f9f4e 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartConfigBase.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Common/BitChartConfigBase.cs @@ -41,7 +41,7 @@ protected BitChartConfigBase(BitChartChartType chartType) /// instead. /// /// - public IList Plugins { get; } = new List(); + public List Plugins { get; } = new List(); /// /// This method tells json.net to only serialize the plugins when there diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Interop/BitChartDelegateHandler.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Interop/BitChartDelegateHandler.cs index d819233bb8..9cd37bc752 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Interop/BitChartDelegateHandler.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Interop/BitChartDelegateHandler.cs @@ -18,7 +18,7 @@ public sealed class BitChartDelegateHandler : IBitChartMethodHandler, IDis private static readonly bool _delegateHasReturnValue; private readonly T _function; - private readonly IList _ignoredIndices; + private readonly List _ignoredIndices; /// /// Gets the name of the method which should be called from JavaScript. diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/LineChart/BitChartScales.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/LineChart/BitChartScales.cs index 6006c28235..7c95fd0caf 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/LineChart/BitChartScales.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/LineChart/BitChartScales.cs @@ -11,11 +11,11 @@ public class BitChartScales /// Gets or sets the configurations for the x-axes. /// [JsonProperty("xAxes")] - public IList XAxes { get; set; } + public List XAxes { get; set; } /// /// Gets or sets the configurations for the y-axes. /// [JsonProperty("yAxes")] - public IList YAxes { get; set; } + public List YAxes { get; set; } } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/Chart/IListExtensions.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/Chart/IListExtensions.cs deleted file mode 100644 index 937f87e752..0000000000 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/Chart/IListExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Bit.BlazorUI.Demo.Client.Core.Pages.Components.Extras.Chart -{ - public static class IListExtensions - { - // Basically a Polyfill since we now expose IList instead of List - // which is better but IList doesn't have AddRange - public static void AddRange(this IList list, IEnumerable items) - { - if (list == null) - throw new ArgumentNullException(nameof(list)); - - if (items == null) - throw new ArgumentNullException(nameof(items)); - - if (list is List asList) - { - asList.AddRange(items); - } - else - { - foreach (var item in items) - { - list.Add(item); - } - } - } - } -} diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/Chart/_BitChartTimeDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/Chart/_BitChartTimeDemo.razor.cs index de9aa6bd1f..ab893c851d 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/Chart/_BitChartTimeDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/Chart/_BitChartTimeDemo.razor.cs @@ -119,7 +119,10 @@ private void RandomizeData() { int count = intDataset.Count; intDataset.Clear(); - intDataset.AddRange(BitChartDemoUtils.RandomScalingFactor(count)); + foreach (var factor in BitChartDemoUtils.RandomScalingFactor(count)) + { + intDataset.Add(factor); + } } } @@ -329,7 +332,10 @@ private void RandomizeData() { int count = intDataset.Count; intDataset.Clear(); - intDataset.AddRange(BitChartDemoUtils.RandomScalingFactor(count)); + foreach (var factor in BitChartDemoUtils.RandomScalingFactor(count)) + { + intDataset.Add(factor); + } } }