简体   繁体   English

Visual Studio设计窗格中的DevExpress WPF主题呈现与已编译应用程序外观不同的外观

[英]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 . 我正在在Visual Studio 2013 12.0.40629.00 Update 5 WPF上使用DevExpress 14.2.10.0开发应用程序。

Compiled application looks diferent from Design Pane in Visual Studio 编译的应用程序看起来与Visual Studio中的设计窗格不同

I use a custom theme developed and compiled with DevExpress WPF Theme Editor and use it in my project with this code: 我使用由DevExpress WPF主题编辑器开发和编译的自定义主题,并通过以下代码在我的项目中使用它:

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. 主题与VS中的“引用”树正确链接,并通过主题引用设置窗格上的复选框在本地复制。

If I use some of DevExpress themes, Design Pane is applying it normally. 如果我使用一些DevExpress主题,则设计窗格将正常应用它。

But if I look at MailClient DevExpress WPF Demo, I see exactly the same situation: 但是,如果我查看MailClient DevExpress WPF演示,则会看到完全相同的情况:

MailClient DevExpress WPF Demo renders default theme incorrect MailClient DevExpress WPF演示呈现默认主题不正确

So the problem is obvious: how to apply custom theme correctly to render it in Design Pane of Visual Studio? 因此问题很明显:如何正确应用自定义主题以在Visual Studio的“设计窗格”中呈现它?


I see a similar question but I use different, (almost) updated software versions unlike this question from 2011. 我看到了一个类似的问题,但与2011年的这个问题不同,我使用了不同的(几乎)更新的软件版本。

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: 找到XAML行以设置自定义DevExpress主题,并将其插入到UserControl的标题中:

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

By default, this theme will not be applied in the XAML designer unless you: 默认情况下,除非您执行以下操作,否则该主题将不会在XAML设计器中应用:

  1. Comment out said line of XAML. 注释掉所说的XAML行。
  2. Compile project, wait for a re-render. 编译项目,等待重新渲染。
  3. Comment in said line of XAML. 在上述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/ 如果没有任何效果,请按Ctrl-Shift-Escape组合键以打开Process Explorer,然后终止XAML设计器呈现过程(它将提供重新加载的过程): http : //blog.spinthemoose.com/2013/03/24/disable-在-XAML的设计师在视觉工作室/

These instructions work for VS2012, VS2013, VS2015, and DevExpress v14 and v15. 这些说明适用于VS2012,VS2013,VS2015和DevExpress v14和v15。

If you work out a better way, please let me know!! 如果您想出更好的方法,请告诉我!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2010 SP1设计时的呈现方式与运行时不同 - Visual Studio 2010 SP1 design time renders differently than runtime 使用WPF的Visual Studio属性窗格的怪癖 - Quirks of Visual Studio's property pane with WPF 在Visual Studio 11中从设计/ xaml窗口切换到代码文件以进行WPF应用程序 - Switch from design/xaml window to code file in visual studio 11 for WPF Application DevExpress Wpf Scheduler主题 - DevExpress Wpf Scheduler theme 如何在我自己的 WPF 应用程序上使用 Visual Studio 11 深色主题? - How to use Visual Studio 11 Dark Theme on my own WPF application? WPF上的Visual Studio设计时FileNotFoundException - Visual Studio Design Time FileNotFoundException on WPF 切换到WPF应用程序的设计视图时,Visual Studio 2008 SP1崩溃的原因 - What causes Visual Studio 2008 SP1 to crash when switch to Design View of a WPF application 视觉设计应用程序:WPF还是WinForms(GDI)? - Visual Design Application: WPF or WinForms(GDI)? Expression Blend和Visual Studio是否以不同的方式呈现WPF控件 - Does Expression Blend and Visual Studio Render WPF Controls Differently 如何设置DevExpress WPF GridControl外观? - How to Set DevExpress WPF GridControl Look And Feel?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM