Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows;
|
---|
6 | using System.Windows.Media;
|
---|
7 | using System.Diagnostics;
|
---|
8 |
|
---|
9 | namespace Microsoft.Research.DynamicDataDisplay.Charts
|
---|
10 | {
|
---|
11 | /// <summary>
|
---|
12 | /// Represents an infinite vertical line with x viewport coordinate.
|
---|
13 | /// </summary>
|
---|
14 | public sealed class VerticalLine : SimpleLine
|
---|
15 | {
|
---|
16 | /// <summary>
|
---|
17 | /// Initializes a new instance of the <see cref="VerticalLine"/> class.
|
---|
18 | /// </summary>
|
---|
19 | public VerticalLine() { }
|
---|
20 |
|
---|
21 | /// <summary>
|
---|
22 | /// Initializes a new instance of the <see cref="VerticalLine"/> class with specified x coordinate.
|
---|
23 | /// </summary>
|
---|
24 | /// <param name="xCoordinate">The x coordinate.</param>
|
---|
25 | public VerticalLine(double xCoordinate)
|
---|
26 | {
|
---|
27 | Value = xCoordinate;
|
---|
28 | }
|
---|
29 |
|
---|
30 | protected override void UpdateUIRepresentationCore()
|
---|
31 | {
|
---|
32 | var transform = Plotter.Viewport.Transform;
|
---|
33 |
|
---|
34 | Point p1 = new Point(Value, Plotter.Viewport.Visible.YMin).DataToScreen(transform);
|
---|
35 | Point p2 = new Point(Value, Plotter.Viewport.Visible.YMax).DataToScreen(transform);
|
---|
36 |
|
---|
37 | LineGeometry.StartPoint = p1;
|
---|
38 | LineGeometry.EndPoint = p2;
|
---|
39 | }
|
---|
40 | }
|
---|
41 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.