Rev | Line | |
---|
[12503] | 1 | using System.Windows;
|
---|
| 2 | using System.Windows.Media;
|
---|
| 3 |
|
---|
| 4 | namespace Microsoft.Research.DynamicDataDisplay.Navigation
|
---|
| 5 | {
|
---|
| 6 | /// <summary>Base class for all navigation providers</summary>
|
---|
| 7 | public abstract class NavigationBase : ViewportElement2D
|
---|
| 8 | {
|
---|
| 9 | protected NavigationBase()
|
---|
| 10 | {
|
---|
| 11 | ManualTranslate = true;
|
---|
| 12 | ManualClip = true;
|
---|
| 13 | Loaded += NavigationBase_Loaded;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | private void NavigationBase_Loaded(object sender, RoutedEventArgs e)
|
---|
| 17 | {
|
---|
| 18 | OnLoaded(e);
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | protected virtual void OnLoaded(RoutedEventArgs e)
|
---|
| 22 | {
|
---|
| 23 | // this call enables contextMenu to be shown after loading and
|
---|
| 24 | // before any changes to Viewport - without this call
|
---|
| 25 | // context menu was not shown.
|
---|
| 26 | InvalidateVisual();
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | protected override void OnRenderCore(DrawingContext dc, RenderState state)
|
---|
| 30 | {
|
---|
| 31 | dc.DrawRectangle(Brushes.Transparent, null, state.Output);
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.