using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RealTimeGraphX { /// /// Represents a graph X/Y range boundaries. /// public interface IGraphRange : IGraphComponent { /// /// Gets or sets the maximum x value. /// IGraphDataPoint MaximumX { get; set; } /// /// Gets or sets the minimum x value. /// IGraphDataPoint MinimumY { get; set; } /// /// Gets or sets the maximum y value. /// IGraphDataPoint MaximumY { get; set; } /// /// Gets or sets a value indicating whether to automatically adjust the graph and according to the current visible data points. /// bool AutoY { get; set; } } /// /// Represents a graph X/Y range boundaries. /// /// Type of x-axis data point. /// Type of y-axis data point. /// public class GraphRange : GraphObject, IGraphRange where XDataPoint : GraphDataPointBase where YDataPoint : GraphDataPointBase { private XDataPoint _maximumX; /// /// Gets or sets the maximum x value. /// public XDataPoint MaximumX { get { return _maximumX; } set { _maximumX = value; RaisePropertyChangedAuto(); } } private YDataPoint _minimumY; /// /// Gets or sets the minimum x value. /// public YDataPoint MinimumY { get { return _minimumY; } set { _minimumY = value; RaisePropertyChangedAuto(); } } private YDataPoint _maximumY; /// /// Gets or sets the maximum y value. /// public YDataPoint MaximumY { get { return _maximumY; } set { _maximumY = value; RaisePropertyChangedAuto(); } } private bool _autoY; /// /// Gets or sets a value indicating whether to automatically adjust the graph and according to the current visible data points. /// public bool AutoY { get { return _autoY; } set { _autoY = value; RaisePropertyChangedAuto(); } } public GraphRange() { MinimumY = GraphDataPointHelper.Init(); MaximumX = GraphDataPointHelper.Init(); MaximumY = GraphDataPointHelper.Init(); } /// /// Gets or sets the maximum x value. /// IGraphDataPoint IGraphRange.MaximumX { get { return MaximumX; } set { MaximumX = (XDataPoint)value; } } /// /// Gets or sets the minimum x value. /// IGraphDataPoint IGraphRange.MinimumY { get { return MinimumY; } set { MinimumY = (YDataPoint)value; } } /// /// Gets or sets the maximum y value. /// IGraphDataPoint IGraphRange.MaximumY { get { return MaximumY; } set { MaximumY = (YDataPoint)value; } } } }