Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Charts/Shapes/SimpleLine.cs @ 12747

Last change on this file since 12747 was 12503, checked in by aballeit, 10 years ago

#2283 added GUI and charts; fixed MCTS

File size: 1.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Media;
6using System.Windows;
7
8namespace 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.