Rev | Line | |
---|
[12503] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows.Controls;
|
---|
| 6 |
|
---|
| 7 | namespace 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.