Show / Hide Table of Contents

Class AeroThemePolicy

Provides the default Aero theme policy which chooses the appropriate theme resources depending on the current system theme and Windows version.

Inheritance
Object
AeroThemePolicy
Implements
IThemePolicy
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: PresentationTheme.Aero
Assembly: PresentationTheme.Aero.dll
Syntax
public class AeroThemePolicy : IThemePolicy
Remarks

Use the policy by passing GetCurrentThemeUri() to SetPresentationFrameworkTheme(IThemePolicy) or SetTheme(Assembly, IThemePolicy).

The policy chooses the following theme resource assemblies:

Windows 8 with Aero themePresentationTheme.Aero.Win8.dll
Windows 8/8.1 with AeroLite themePresentationTheme.AeroLite.Win8.dll
Windows 8/8.1 in high contrast mode PresentationTheme.HighContrast.Win8.dll
Windows 10 with Aero themePresentationTheme.Aero.Win10.dll
Windows 10 with AeroLite themePresentationTheme.AeroLite.Win10.dll
Windows 10 in high contrast mode PresentationTheme.HighContrast.Win10.dll
Other Windows versionsFallback to default theme

Methods

| Improve this Doc View Source

GetCurrentThemeUri()

Builds the pack Uri for the theme resources matching the current system theme and Windows version.

Declaration
public virtual Uri GetCurrentThemeUri()
Returns
Type Description
Uri

An absolute pack Uri to a ResourceDictionary with the theme resources. Returns null if the current system theme or Windows version are not supported.

| Improve this Doc View Source

GetThemeResourceName(Version, String, String, Boolean)

Gets theme resource name matching the current system theme and Windows version.

Declaration
protected virtual string GetThemeResourceName(Version osVersion, string themeName, string themeColor, bool highContrast)
Parameters
Type Name Description
Version osVersion

The Windows version.

String themeName

The system theme name.

String themeColor

The system theme color.

Boolean highContrast

Indicates whether Windows is in high contrast mode.

Returns
Type Description
String

An absolute pack Uri to a ResourceDictionary with the theme resources.

Explicit Interface Implementations

| Improve this Doc View Source

IThemePolicy.MergeWithBaseResources

Declaration
bool IThemePolicy.MergeWithBaseResources { get; }
Returns
Type Description
Boolean

Implements

IThemePolicy
  • Improve this Doc
  • View Source
Back to top Generated by DocFX