Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed GroupBoxHelper and added a new AttachedProperty
- Rename GroupBoxHelper to HeaderedControlHelper - Added AttachedProperty HeaderBackground
- Loading branch information
Showing
8 changed files
with
131 additions
and
100 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
src/MahApps.Metro/Controls/Helper/HeaderedControlHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.