using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Diagnostics;
namespace Microsoft.Research.DynamicDataDisplay.Charts
{
///
/// Represents an infinite vertical line with x viewport coordinate.
///
public sealed class VerticalLine : SimpleLine
{
///
/// Initializes a new instance of the class.
///
public VerticalLine() { }
///
/// Initializes a new instance of the class with specified x coordinate.
///
/// The x coordinate.
public VerticalLine(double xCoordinate)
{
Value = xCoordinate;
}
protected override void UpdateUIRepresentationCore()
{
var transform = Plotter.Viewport.Transform;
Point p1 = new Point(Value, Plotter.Viewport.Visible.YMin).DataToScreen(transform);
Point p2 = new Point(Value, Plotter.Viewport.Visible.YMax).DataToScreen(transform);
LineGeometry.StartPoint = p1;
LineGeometry.EndPoint = p2;
}
}
}