Back to Devexpress

ApplicationThemeHelper.ConfigurationUserLevel Property

wpf-devexpress-dot-xpf-dot-core-dot-applicationthemehelper-318e1187.md

latest2.9 KB
Original Source

ApplicationThemeHelper.ConfigurationUserLevel Property

Gets or sets where to save the application theme name.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public static ConfigurationUserLevel ConfigurationUserLevel { get; set; }
vb
Public Shared Property ConfigurationUserLevel As ConfigurationUserLevel

Property Value

TypeDefaultDescription
ConfigurationUserLevelPerUserRoaming

A path to the application configuration file.

|

Remarks

The ConfigurationUserLevel property specifies the path used by the SaveApplicationThemeName() method to save the name of the theme applied at runtime:

ConfigurationUserLevel.PerUserRoaming (default value)Saves the applied theme name to the %AppData%\{AppName}\{AppName.exe_Url_id}\{version}\user.config file.ConfigurationUserLevel.PerUserRoamingAndLocalSaves the applied theme name to the %LocalAppData%\{AppName}\{AppName.exe_Url_id}\{version}\user.config file.ConfigurationUserLevel.NoneSaves the applied theme name to the application configuration file ({AppDirectory}\{AppName.exe}.Config).

The following code sample demonstrates how to use the ConfigurationUserLevel property:

csharp
public partial class App : Application {
    public App() {
        // ...
    }
    static App() {
        ApplicationThemeHelper.ConfigurationUserLevel = ConfigurationUserLevel.None;
    }
    protected override void OnExit(ExitEventArgs e) {
        base.OnExit(e);
        ApplicationThemeHelper.SaveApplicationThemeName();
    }
}
vb
Public Partial Class App
    Inherits Application

    Public Sub New()
    ' ...
    End Sub

    Private Shared Sub New()
        ApplicationThemeHelper.ConfigurationUserLevel = ConfigurationUserLevel.None
    End Sub

    Protected Overrides Sub OnExit(ByVal e As ExitEventArgs)
        MyBase.OnExit(e)
        ApplicationThemeHelper.SaveApplicationThemeName()
    End Sub
End Class

Refer to the following help topic for more information: WPF Application Themes.

See Also

ApplicationThemeHelper Class

ApplicationThemeHelper Members

DevExpress.Xpf.Core Namespace