DevExpress WPF theme in Design Pane of Visual Studio renders differently from compiled application look

I am developing an application with DevExpress 14.2.10.0 on WPF in Visual Studio 2013 12.0.40629.00 Update 5.

Compiled application looks diferent from Design Pane in Visual Studio

I use a custom theme developed and compiled with DevExpress WPF Theme Editor and use it in my project with this code:

public MainWindow()
    {
        var theme = new Theme("EstiwLight", "DevExpress.Xpf.Themes.EstiwLight.v14.2")
        {
            AssemblyName = "DevExpress.Xpf.Themes.EstiwLight.v14.2"
        };
        Theme.RegisterTheme(theme);
        ThemeManager.ApplicationThemeName = "EstiwLight";
        InitializeComponent();
    }

Theme is properly linked with References tree in VS and copied locally with checkbox on theme reference settings pane.

If I use some of DevExpress themes, Design Pane is applying it normally.

But if I look at MailClient DevExpress WPF Demo, I see exactly the same situation:

MailClient DevExpress WPF Demo renders default theme incorrect

So the problem is obvious: how to apply custom theme correctly to render it in Design Pane of Visual Studio?


I see a similar question but I use different, (almost) updated software versions unlike this question from 2011.

Upvotes: 1

Views: 533

Answers (1)

Contango
Contango

Reputation: 80222

I've run into this same issue as well.

Find the XAML line to set a custom DevExpress theme, and insert it into the header of your UserControl:

https://documentation.devexpress.com/#WPF/CustomDocument7407

By default, this theme will not be applied in the XAML designer unless you:

  1. Comment out said line of XAML.
  2. Compile project, wait for a re-render.
  3. Comment in said line of XAML.
  4. Compile project, wait for a re-render.

If nothing is working, press Ctrl-Shift-Escape to bring up Process Explorer, then kill the XAML designer rendering process (it will offer to reload): http://blog.spinthemoose.com/2013/03/24/disable-the-xaml-designer-in-visual-studio/

These instructions work for VS2012, VS2013, VS2015, and DevExpress v14 and v15.

If you work out a better way, please let me know!!

Upvotes: 1

Related Questions