PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/Charts/Navigation/Navigation/NavigationBase.cs

#
C# | 25 lines | 20 code | 4 blank | 1 comment | 0 complexity | 344bb948946dccf8772639bdf87bcd8a MD5 | raw file
 1using System.Windows;
 2using System.Windows.Media;
 3
 4namespace Microsoft.Research.DynamicDataDisplay.Navigation
 5{
 6    /// <summary>Base class for all navigation providers</summary>
 7	public abstract class NavigationBase : ViewportElement2D {
 8		protected NavigationBase() {
 9			ManualTranslate = true;
10			ManualClip = true;
11			Loaded += NavigationBase_Loaded;
12		}
13
14		private void NavigationBase_Loaded(object sender, RoutedEventArgs e) {
15			OnLoaded(e);
16		}
17
18		protected virtual void OnLoaded(RoutedEventArgs e) { }
19
20		protected override void OnRenderCore(DrawingContext dc, RenderState state) {
21			Color color = Color.FromArgb(0, 0, 0, 0);
22			dc.DrawRectangle(new SolidColorBrush(color), null, state.Output);
23		}
24	}
25}