使 WPF 应用程序看起来像 Metro 风格,即使在 Windows 7 中?(窗口铬/主题/主题) [英] Making WPF applications look Metro-styled, even in Windows 7? (Window Chrome / Theming / Theme)

查看:25
本文介绍了使 WPF 应用程序看起来像 Metro 风格,即使在 Windows 7 中?(窗口铬/主题/主题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢新 Office 套件和 Visual Studio 上的窗口镶边:

I like the window chrome on the new Office Suite and Visual Studio:

当然,我仍在为 Windows 7 开发应用程序,但我想知道是否有一种快速简便的方法(阅读:WPF 样式或 Windows 库)来模拟这种样式.我过去做过一些窗口镶边样式,但让它看起来和行为恰到好处真的很棘手.

I'm still developing applications for Windows 7 of course, but I'm wondering if there's a quick and easy way (read: WPF style or Windows Library) to emulate this style. I've done some window chrome styling in the past, but getting it to look and behave just right is really tricky.

有谁知道是否有现有的模板或库可以为我的 WPF 应用程序添加现代 UI"外观和感觉?

Does anyone know if there are existing templates or libraries to add a "Modern UI" look and feel to my WPF applications?

推荐答案

我最终选择的解决方案是 MahApps.Metro (github),其中(现在在两个软件上使用后) 我认为一个优秀的 UI 工具包 (归功于 Oliver Vogel 的建议).

The solution I ended up choosing was MahApps.Metro (github), which (after using it on two pieces of software now) I consider an excellent UI kit (credit to Oliver Vogel for the suggestion).

它只需很少的工作即可为应用程序设置外观,并且对标准 Windows 8 控件进行了改编.它非常健壮.

It skins the application with very little effort required, and has adaptations of the standard Windows 8 controls. It's very robust.

Nuget 上提供了一个版本:

A version is available on Nuget:

您可以使用 GUI 通过 Nuget 安装 MahApps.Metro(右键单击您的项目,管理 Nuget 引用,搜索MahApps.Metro")或通过控制台:

You can install MahApps.Metro via Nuget using the GUI (right click on your project, Manage Nuget References, search for ‘MahApps.Metro’) or via the console:

PM> 安装包 MahApps.Metro

PM> Install-Package MahApps.Metro

它也是免费——即使用于商业用途.

It's also free -- even for commercial use.

我发现 MahApps.Metro 的 Github 版本包含了当前 nuget 版本中没有的控件和样式,包括:

I discovered that the Github version of MahApps.Metro is packed with controls and styles that aren't available in the current nuget version, including:

github 存储库非常活跃,有相当多的用户贡献.我建议检查一下.

The github repository is very active with quite a bit of user contributions. I recommend checking it out.

这篇关于使 WPF 应用程序看起来像 Metro 风格,即使在 Windows 7 中?(窗口铬/主题/主题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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