如何从WPF获取窗口主题xaml代码? [英] How to get window theme xaml code from WPF?

查看:77
本文介绍了如何从WPF获取窗口主题xaml代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


如何从WPF获取完整的窗口主题?我想要没有绑定的所有控件的完整代码。这意味着所有颜色,图形等都在一个xaml文件下。


我使用Blend 2015(来自VisualStudio 2015 CE)并且我可以复制模板,但这个副本不是100%拷贝,但只有部分副本,其中所有其他方面缺少颜色,状态动画等...


我在VS目录下找到了一些xaml文件。在主题下命名为areo.normalcolor.xaml,它看起来像我正在寻找的,但仍然有一些系统颜色的绑定。

解决方案

< blockquote>

Hi Striebrovlas,


由于WPF控件的外观是由模板定义的,因此WPF包含每个已知Windows主题的模板,包括Aero(Windows Vista),Classic(Microsoft Windows) 2000),Luna(Microsoft Windows XP)和Royale XP Media Center Edition 2005。



您可以使用ILSpy查看这些主题的样式。



据我所知,默认情况下,几乎所有系统WPF控件都没有动画,如果你不喜欢,你可以在Visual Studio上复制模板来改变外观它,
你也可以在这里查看默认的ControlTemplate。


https://msdn.microsoft.com/en-us/library/aa970773(v = vs.85).aspx


希望它可以提供帮助你好。


最好的问候,


Bob


Hello

how can I get full window theme from WPF? I want full code for all controls without bindings. That means all colors, graphics etc.. is under one xaml file.

I use Blend 2015 (from VisualStudio 2015 CE) and I can copy template, but this copy is not 100% copy, but only partial copy, where all other aspect missing like colors, states animations etc...

I found some xaml files under VS directory. Named like areo.normalcolor.xaml under Themes and it is looks like what I am looking for, but there are still some bindings to the system color.

解决方案

Hi Striebrovlas,

Since WPF control's appearance is defined by a template, WPF includes a template for each known Windows theme, including Aero (Windows Vista), Classic (Microsoft Windows 2000), Luna (Microsoft Windows XP), and Royale XP Media Center Edition 2005).

You can use ILSpy to view the style of these themes .

As far as I know ,almost all system WPF controls do not come with animations by default, you can just copy template on Visual Studio to change the appearance if you don't like it, you can also check the default ControlTemplate here.

https://msdn.microsoft.com/en-us/library/aa970773(v=vs.85).aspx

Hope it could help you.

Best Regards,

Bob


这篇关于如何从WPF获取窗口主题xaml代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆