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