首页 > Windows开发 > 详细

WPF关于Generic.xaml

时间:2015-02-23 22:18:48      阅读:500      评论:0      收藏:0      [点我收藏+]

如果需要用到Themes/Generic.xaml作为默认风格资源文件,不要忘了该项目的AssemblyInfo.cs中必须要有以下这段:

[assembly: ThemeInfo(
    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
    //(used if a resource is not found in the page, 
    // or application resource dictionaries)
    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
    //(used if a resource is not found in the page, 
    // app, or any theme specific resource dictionaries)
)]

否则,程序将自动取当前操作系统风格。

这段没有的原因很可能是WPF项目是从别处拷来而不是直接在vs里创建的。

WPF关于Generic.xaml

原文:http://www.cnblogs.com/dfun/p/4298290.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!