[英]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设计器中应用:
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.