// -------------------------------------------------------------------------------------------------------------------- // // Copyright (c) 2014 OxyPlot contributors // // // This is a Avalonia wrapper of OxyPlot.BarSeries // // -------------------------------------------------------------------------------------------------------------------- using Avalonia; namespace OxyPlot.Avalonia { using OxyPlot.Series; /// /// This is a Avalonia wrapper of OxyPlot.BarSeries /// public class BarSeries : BarSeriesBase { /// /// Identifies the dependency property. /// public static readonly StyledProperty BarWidthProperty = AvaloniaProperty.Register(nameof(BarWidth), 1.0); /// /// Initializes a new instance of the class. /// public BarSeries() { InternalSeries = new OxyPlot.Series.BarSeries(); } /// /// Gets or sets the bar width. /// public double BarWidth { get { return GetValue(BarWidthProperty); } set { SetValue(BarWidthProperty, value); } } /// /// Synchronizes the properties. /// /// The series. protected override void SynchronizeProperties(OxyPlot.Series.Series series) { base.SynchronizeProperties(series); var s = (OxyPlot.Series.BarSeries)series; s.BarWidth = BarWidth; } static BarSeries() { BarWidthProperty.Changed.AddClassHandler(AppearanceChanged); } } }