-
Notifications
You must be signed in to change notification settings - Fork 6
/
ThemeOptions.cs
57 lines (52 loc) · 2.04 KB
/
ThemeOptions.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
45
46
47
48
49
50
51
52
53
54
55
56
57
namespace PresentationTheme.Aero
{
using System.Windows;
using System.Windows.Controls;
/// <summary>Provides options to customize theme styles.</summary>
public static class ThemeOptions
{
#region public bool UseExplorerStyle { get; set; }
/// <summary>
/// Identifies the UseExplorerStyle attached dependency property.
/// </summary>
public static readonly DependencyProperty UseExplorerStyleProperty =
DependencyProperty.RegisterAttached(
"UseExplorerStyle",
typeof(bool),
typeof(ThemeOptions),
new FrameworkPropertyMetadata(
false,
FrameworkPropertyMetadataOptions.AffectsMeasure |
FrameworkPropertyMetadataOptions.Inherits));
/// <summary>
/// Gets a value indicating whether a <see cref="Control"/> should use
/// the Explorer style if supported.
/// </summary>
/// <param name="control">
/// The control from which to read the property value.
/// </param>
/// <remarks>
/// Supported controls are <see cref="ListView"/> and <see cref="TreeView"/>.
/// </remarks>
public static bool GetUseExplorerStyle(Control control)
{
return (bool)control.GetValue(UseExplorerStyleProperty);
}
/// <summary>
/// Sets a value indicating whether a <see cref="Control"/> should use
/// the Explorer style if supported.
/// </summary>
/// <param name="control">
/// The control on which to set the attached property.
/// </param>
/// <param name="value">The property value to set.</param>
/// <remarks>
/// Supported controls are <see cref="ListView"/> and <see cref="TreeView"/>.
/// </remarks>
public static void SetUseExplorerStyle(Control control, bool value)
{
control.SetValue(UseExplorerStyleProperty, value);
}
#endregion
}
}