ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [DX_WPF] DevExpress Default Theme
    DevExpress/DX_WPF 2024. 3. 29. 15:40

     

    DevExpress 기본 테마는 Office2019Colorful 고정

    GetDefaultThemeName() 는 private이라 못 불러옴

    public static void UpdateApplicationThemeName()
    {
      if (!CompatibilitySettings.UseLightweightThemes && ApplicationThemeHelper.UseLegacyDefaultTheme || ApplicationThemeHelper.IsWebApp || ApplicationThemeHelper.IsInDesignMode || !string.IsNullOrEmpty(ApplicationThemeHelper.ApplicationThemeName) && ApplicationThemeHelper.ApplicationThemeName != ApplicationThemeHelper.GetDefaultThemeName())
        return;
      System.Configuration.Configuration config = ApplicationThemeHelper.GetConfig();
      string themeNameFromConfig = config == null ? (string) null : ConfigurationHelper.GetApplicationThemeNameFromConfig(config);
      ApplicationThemeHelper.ApplicationThemeName = string.IsNullOrEmpty(themeNameFromConfig) ? ApplicationThemeHelper.GetDefaultThemeName() : themeNameFromConfig;
    }

     

     

     

    UpdateApplicationThemeName()에서 DevExpress theme config파일이 있는지 판별.

     

     

     

     

    아래 방법으로 변경.

    ApplicationThemeHelper.UpdateApplicationThemeName();
    var config = string.IsNullOrEmpty(Assembly.GetExecutingAssembly().Location) ? (System.Configuration.Configuration)null : ConfigurationManager.OpenExeConfiguration(ApplicationThemeHelper.ConfigurationUserLevel);
    if (!config.HasFile)
        ApplicationThemeHelper.ApplicationThemeName = Theme.Win11DarkName;

     

     

     

     

    728x90

    'DevExpress > DX_WPF' 카테고리의 다른 글

    [DX_WPF] InjectOrNavigate Parameter  (0) 2024.04.29
    [DX_WPF] HamburgerMenu  (0) 2024.04.15
    [DX_WPF] DialogService  (0) 2024.03.27
    [DX_WPF] DevExpress Service  (0) 2024.03.21
    [DX_WPF] ViewModelFactory  (0) 2024.03.21

    댓글

Designed by Tistory.