-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomDataTip.xaml.cs
More file actions
67 lines (58 loc) · 1.99 KB
/
CustomDataTip.xaml.cs
File metadata and controls
67 lines (58 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Windows.Controls;
using System.Windows.Media;
namespace CustomDataTip
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public partial class CustomDataTipControl : UserControl
{
/// <summary>
/// Foreground color
/// </summary>
public SolidColorBrush ForeBrush { get; set; }
/// <summary>
/// Background color
/// </summary>
public SolidColorBrush BackBrush { get; set; }
/// <summary>
/// Creates the control and sets the background from the VS theme
/// </summary>
public CustomDataTipControl()
{
InitializeComponent();
var theme = ThemeUtil.GetCurrentTheme();
BackBrush = Brushes.DarkGray;
ForeBrush = Brushes.AntiqueWhite;
var converter = new BrushConverter();
switch (theme)
{
case VsTheme.Blue:
BackBrush = (SolidColorBrush)converter.ConvertFromString("#FF1B5277");
break;
case VsTheme.Dark:
BackBrush = Brushes.DimGray;
break;
case VsTheme.Light:
BackBrush = Brushes.LightGray;
ForeBrush = Brushes.Black;
break;
case VsTheme.Unknown:
BackBrush = Brushes.DarkGray;
break;
default:
throw new ArgumentOutOfRangeException();
}
PinButton.Background = BackBrush;
PinButton.Foreground = ForeBrush;
PinButton.BorderBrush = ForeBrush;
ExportButton.Background = BackBrush;
ExportButton.Foreground = ForeBrush;
ExportButton.BorderBrush = ForeBrush;
Grid.Background = BackBrush;
ResultTreeView.Background = BackBrush;
ResultTreeView.Foreground = ForeBrush;
}
}
}