// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
using System.Collections.ObjectModel;
namespace System.Windows.Controls.DataVisualization.Charting
{
///
/// Represents a control that contains a data series.
///
/// Preview
public abstract partial class Series : Control, ISeries, IRequireSeriesHost
{
///
/// The name of the Title property.
///
protected const string TitleName = "Title";
#region public ISeriesHost SeriesHost
///
/// Gets or sets the parent instance the Series belongs to.
///
public ISeriesHost SeriesHost
{
get { return _seriesHost; }
set
{
ISeriesHost oldValue = _seriesHost;
_seriesHost = value;
if (oldValue != _seriesHost)
{
OnSeriesHostPropertyChanged(oldValue, _seriesHost);
}
}
}
///
/// Stores the Parent instance the Series belongs to.
///
private ISeriesHost _seriesHost;
///
/// Called when the value of the SeriesHost property changes.
///
/// The value to be replaced.
/// The new series host value.
protected virtual void OnSeriesHostPropertyChanged(ISeriesHost oldValue, ISeriesHost newValue)
{
if (newValue != null && oldValue != null)
{
throw new InvalidOperationException(Properties.Resources.Series_SeriesHost_SeriesHostPropertyNotNull);
}
}
#endregion public ISeriesHost SeriesHost
#region public ObservableCollection