2

大家好,我正在尝试为 WPF 3.5 中的元素调用当前的 windows 主题。

当用户更改窗口主题时,我的应用程序也应该根据主题进行更改。

我正在使用样式。

请帮我。

4

1 回答 1

2

您可以通过将资源字典添加到 Themes 文件夹来根据桌面主题定义不同的外观。桌面主题确定使用哪个资源字典。以下是资源字典文件名和桌面主题的列表:

  1. Classic.xaml – Windows XP 上的“经典”Windows 9x/2000 外观。
  2. Luna.NormalColor.xaml – Windows XP 上的默认蓝色主题。
  3. Luna.Homestead.xaml – Windows XP 上的橄榄色主题。
  4. Luna.Metallic.xaml – Windows XP 上的银色主题。
  5. Royale.NormalColor.xaml – Windows XP Media Center Edition 上的默认主题。
  6. Zune.NormalColor.xaml – Windows XP Zune 上的默认主题。
  7. Aero.NormalColor.xaml – Windows Vista 上的默认主题 ...

您可以在那里阅读详细信息(http://blogs.msdn.com/wpfsdk/archive/2007/07/31/using-themes-with-custom-controls.aspx

于 2009-04-23T13:15:59.483 回答