How to invoke windows theme in WPF?

纵然是瞬间 提交于 2019-12-30 05:23:06

问题


Hi Folks I am trying to invoke the current theme of windows for my elements in WPF 3.5.

as the user change the window theme my application should also be changed according to the theme.

I am using styles.

Please help me.


回答1:


You can define a different look and feel based on the desktop theme by adding a resource dictionary to the Themes folder. The desktop theme determine which resource dictionary is used. Here is a list the resource dictionary file names and the desktop themes:

  1. Classic.xaml – “Classic” Windows 9x/2000 look on Windows XP.
  2. Luna.NormalColor.xaml – Default blue theme on Windows XP.
  3. Luna.Homestead.xaml – Olive theme on Windows XP.
  4. Luna.Metallic.xaml – Silver theme on Windows XP.
  5. Royale.NormalColor.xaml – Default theme on Windows XP Media Center Edition.
  6. Zune.NormalColor.xaml – Default theme on Windows XP Zune.
  7. Aero.NormalColor.xaml – Default theme on Windows Vista ...

You can read details there (http://blogs.msdn.com/wpfsdk/archive/2007/07/31/using-themes-with-custom-controls.aspx)



来源:https://stackoverflow.com/questions/781217/how-to-invoke-windows-theme-in-wpf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!