-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
HeaderedControlHelper.cs
44 lines (36 loc) · 1.59 KB
/
HeaderedControlHelper.cs
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
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace MahApps.Metro.Controls
{
using System.ComponentModel;
public static class HeaderedControlHelper
{
public static readonly DependencyProperty HeaderForegroundProperty =
DependencyProperty.RegisterAttached("HeaderForeground", typeof(Brush), typeof(HeaderedControlHelper), new UIPropertyMetadata(Brushes.White));
[Category(AppName.MahApps)]
[AttachedPropertyBrowsableForType(typeof(GroupBox))]
[AttachedPropertyBrowsableForType(typeof(Expander))]
public static Brush GetHeaderForeground(UIElement element)
{
return (Brush)element.GetValue(HeaderForegroundProperty);
}
public static void SetHeaderForeground(UIElement element, Brush value)
{
element.SetValue(HeaderForegroundProperty, value);
}
public static readonly DependencyProperty HeaderBackgroundProperty =
DependencyProperty.RegisterAttached("HeaderBackground", typeof(Brush), typeof(HeaderedControlHelper), new UIPropertyMetadata(null));
[Category(AppName.MahApps)]
[AttachedPropertyBrowsableForType(typeof(GroupBox))]
[AttachedPropertyBrowsableForType(typeof(Expander))]
public static Brush GetHeaderBackground(UIElement element)
{
return (Brush)element.GetValue(HeaderBackgroundProperty);
}
public static void SetHeaderBackground(UIElement element, Brush value)
{
element.SetValue(HeaderBackgroundProperty, value);
}
}
}