BarSeriesBase{T}.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright file="BarSeriesBase{T}.cs" company="OxyPlot">
  3. // Copyright (c) 2014 OxyPlot contributors
  4. // </copyright>
  5. // <summary>
  6. // This is a Avalonia wrapper of OxyPlot.BarSeries&lt;T&gt;.
  7. // </summary>
  8. // --------------------------------------------------------------------------------------------------------------------
  9. namespace OxyPlot.Avalonia
  10. {
  11. /// <summary>
  12. /// This is a Avalonia wrapper of OxyPlot.BarSeries&lt;T&gt;.
  13. /// </summary>
  14. /// <typeparam name="T">The type of the items.</typeparam>
  15. public class BarSeriesBase<T> : BarSeriesBase
  16. where T : OxyPlot.Series.BarItemBase, new()
  17. {
  18. /// <summary>
  19. /// Synchronizes the properties.
  20. /// </summary>
  21. /// <param name="series">The series.</param>
  22. protected override void SynchronizeProperties(OxyPlot.Series.Series series)
  23. {
  24. base.SynchronizeProperties(series);
  25. if (Items != null)
  26. {
  27. var s = (OxyPlot.Series.BarSeriesBase<T>)series;
  28. s.Items.Clear();
  29. foreach (T item in Items)
  30. {
  31. s.Items.Add(item);
  32. }
  33. }
  34. }
  35. }
  36. }