Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Charts/Panels/PlotterPanelBase.cs @ 13398

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

#2283 added GUI and charts; fixed MCTS

File size: 888 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Controls;
6
7namespace Microsoft.Research.DynamicDataDisplay.Charts
8{
9  public abstract class PlotterPanelBase : ContentControl, IPlotterElement
10  {
11    private Plotter2D plotter;
12
13    protected abstract Panel GetPanel(Plotter plotter);
14
15    #region IPlotterElement Members
16
17    public void OnPlotterAttached(Plotter plotter)
18    {
19      this.plotter = (Plotter2D)plotter;
20     
21      Panel panel = GetPanel(plotter);
22      panel.Children.Add(this);
23    }
24
25    public void OnPlotterDetaching(Plotter plotter)
26    {
27      Panel panel = GetPanel(plotter);
28      panel.Children.Remove(this);
29
30      this.plotter = null;
31    }
32
33    public Plotter2D Plotter
34    {
35      get { return plotter; }
36    }
37
38    Plotter IPlotterElement.Plotter
39    {
40      get { return plotter; }
41    }
42
43    #endregion
44  }
45}
Note: See TracBrowser for help on using the repository browser.