Rev | Line | |
---|
[12503] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows.Media;
|
---|
| 6 | using System.Windows;
|
---|
| 7 |
|
---|
| 8 | namespace Microsoft.Research.DynamicDataDisplay.Charts
|
---|
| 9 | {
|
---|
| 10 | /// <summary>
|
---|
| 11 | /// Represents simple line bound to viewport coordinates.
|
---|
| 12 | /// </summary>
|
---|
| 13 | public abstract class SimpleLine : ViewportShape
|
---|
| 14 | {
|
---|
| 15 | /// <summary>
|
---|
| 16 | /// Initializes a new instance of the <see cref="SimpleLine"/> class.
|
---|
| 17 | /// </summary>
|
---|
| 18 | protected SimpleLine() { }
|
---|
| 19 |
|
---|
| 20 | /// <summary>
|
---|
| 21 | /// Gets or sets the value of line - e.g., its horizontal or vertical coordinate.
|
---|
| 22 | /// </summary>
|
---|
| 23 | /// <value>The value.</value>
|
---|
| 24 | public double Value
|
---|
| 25 | {
|
---|
| 26 | get { return (double)GetValue(ValueProperty); }
|
---|
| 27 | set { SetValue(ValueProperty, value); }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | /// <summary>
|
---|
| 31 | /// Identifies Value dependency property.
|
---|
| 32 | /// </summary>
|
---|
| 33 | public static readonly DependencyProperty ValueProperty =
|
---|
| 34 | DependencyProperty.Register(
|
---|
| 35 | "Value",
|
---|
| 36 | typeof(double),
|
---|
| 37 | typeof(SimpleLine),
|
---|
| 38 | new PropertyMetadata(
|
---|
| 39 | 0.0, OnValueChanged));
|
---|
| 40 |
|
---|
| 41 | private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
---|
| 42 | {
|
---|
| 43 | SimpleLine line = (SimpleLine)d;
|
---|
| 44 | line.OnValueChanged();
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | protected virtual void OnValueChanged()
|
---|
| 48 | {
|
---|
| 49 | UpdateUIRepresentation();
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | private LineGeometry lineGeometry = new LineGeometry();
|
---|
| 53 | protected LineGeometry LineGeometry
|
---|
| 54 | {
|
---|
| 55 | get { return lineGeometry; }
|
---|
| 56 | }
|
---|
| 57 | protected override Geometry DefiningGeometry
|
---|
| 58 | {
|
---|
| 59 | get { return lineGeometry; }
|
---|
| 60 | }
|
---|
| 61 | }
|
---|
| 62 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.