Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/InjectedViewport2D.cs @ 13857

Last change on this file since 13857 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 910 bytes
RevLine 
[12503]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6
7namespace Microsoft.Research.DynamicDataDisplay
8{
9  /// <summary>
10  /// Represents a Viewport of InjectedPlotter, which has a way for InjectedPlottter to change the behavior of
11  /// how Visible property is coerced in dependence on Parent plotter's Visible.
12  /// </summary>
13  internal sealed class InjectedViewport2D : Viewport2D
14  {
15    internal InjectedViewport2D(FrameworkElement host, Plotter2D plotter) : base(host, plotter) { }
16
17    protected override DataRect CoerceVisible(DataRect newVisible)
18    {
19      DataRect baseValue = base.CoerceVisible(newVisible);
20      if (CoerceVisibleFunc != null)
21        return CoerceVisibleFunc(newVisible, baseValue);
22      else
23        return baseValue;
24    }
25
26    public Func<DataRect, DataRect, DataRect> CoerceVisibleFunc
27    {
28      get;
29      set;
30    }
31  }
32}
Note: See TracBrowser for help on using the repository browser.