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