PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/Charts/LiveTooltips/LiveTooltip.cs

#
C# | 51 lines | 44 code | 7 blank | 0 comment | 0 complexity | bfbbfdb51d30b43782c7c630b8217165 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.Windows.Controls;
 6using System.Windows;
 7using System.Windows.Media;
 8using System.Windows.Input;
 9using System.Diagnostics;
10
11namespace Microsoft.Research.DynamicDataDisplay.Charts
12{
13	public class LiveToolTip : ContentControl
14	{
15		static int nameCounter = 0;
16		static LiveToolTip()
17		{
18			var thisType = typeof(LiveToolTip);
19
20			DefaultStyleKeyProperty.OverrideMetadata(thisType, new FrameworkPropertyMetadata(thisType));
21			FocusableProperty.OverrideMetadata(thisType, new FrameworkPropertyMetadata(false));
22			IsHitTestVisibleProperty.OverrideMetadata(thisType, new FrameworkPropertyMetadata(false));
23			BackgroundProperty.OverrideMetadata(thisType, new FrameworkPropertyMetadata(Brushes.White));
24			OpacityProperty.OverrideMetadata(thisType, new FrameworkPropertyMetadata(1.0));
25			BorderBrushProperty.OverrideMetadata(thisType, new FrameworkPropertyMetadata(Brushes.DarkGray));
26			BorderThicknessProperty.OverrideMetadata(thisType, new FrameworkPropertyMetadata(new Thickness(1.0)));
27		}
28
29		public LiveToolTip()
30		{
31			Name = "Microsoft_Research_Dynamic_Data_Display_Charts_LiveToolTip_" + nameCounter;
32			nameCounter++;
33		}
34
35		#region Properties
36
37		public FrameworkElement Owner
38		{
39			get { return (FrameworkElement)GetValue(OwnerProperty); }
40			set { SetValue(OwnerProperty, value); }
41		}
42
43		public static readonly DependencyProperty OwnerProperty = DependencyProperty.Register(
44		  "Owner",
45		  typeof(FrameworkElement),
46		  typeof(LiveToolTip),
47		  new FrameworkPropertyMetadata(null));
48
49		#endregion // end of Properties
50	}
51}