Class AeroThemePolicy
Provides the default Aero theme policy which chooses the appropriate theme resources depending on the current system theme and Windows version.
Implements
Inherited Members
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 theme | PresentationTheme.Aero.Win8.dll |
Windows 8/8.1 with AeroLite theme | PresentationTheme.AeroLite.Win8.dll |
Windows 8/8.1 in high contrast mode |
PresentationTheme.HighContrast.Win8.dll
|
Windows 10 with Aero theme | PresentationTheme.Aero.Win10.dll |
Windows 10 with AeroLite theme | PresentationTheme.AeroLite.Win10.dll |
Windows 10 in high contrast mode |
PresentationTheme.HighContrast.Win10.dll
|
Other Windows versions | Fallback to default theme |
Methods
| Improve this Doc View SourceGetCurrentThemeUri()
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. |
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 SourceIThemePolicy.MergeWithBaseResources
Declaration
bool IThemePolicy.MergeWithBaseResources { get; }
Returns
Type | Description |
---|---|
Boolean |