// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) 2014 OxyPlot contributors
//
//
// Abstract base class for series that use X and Y axes.
//
// --------------------------------------------------------------------------------------------------------------------
using Avalonia;
namespace OxyPlot.Avalonia
{
///
/// Abstract base class for series that use X and Y axes.
///
public abstract class XYAxisSeries : ItemsSeries
{
///
/// Identifies the dependency property.
///
public static readonly StyledProperty XAxisKeyProperty = AvaloniaProperty.Register(nameof(XAxisKey), null);
///
/// Identifies the dependency property.
///
public static readonly StyledProperty YAxisKeyProperty = AvaloniaProperty.Register(nameof(YAxisKey), null);
///
/// Initializes static members of the class.
///
static XYAxisSeries()
{
TrackerFormatStringProperty.OverrideMetadata(typeof(XYAxisSeries), new StyledPropertyMetadata(OxyPlot.Series.XYAxisSeries.DefaultTrackerFormatString));
XAxisKeyProperty.Changed.AddClassHandler(AppearanceChanged);
YAxisKeyProperty.Changed.AddClassHandler(AppearanceChanged);
TrackerFormatStringProperty.Changed.AddClassHandler(AppearanceChanged);
}
///
/// Gets or sets the x-axis key.
///
public string XAxisKey
{
get
{
return GetValue(XAxisKeyProperty);
}
set
{
SetValue(XAxisKeyProperty, value);
}
}
///
/// Gets or sets the y axis key.
///
public string YAxisKey
{
get
{
return GetValue(YAxisKeyProperty);
}
set
{
SetValue(YAxisKeyProperty, value);
}
}
///
/// Synchronizes the properties.
///
/// The series.
protected override void SynchronizeProperties(OxyPlot.Series.Series series)
{
base.SynchronizeProperties(series);
var s = (OxyPlot.Series.XYAxisSeries)series;
s.XAxisKey = XAxisKey;
s.YAxisKey = YAxisKey;
}
}
}