像 Windows 10 设置应用程序一样开发 WPF 应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33562034/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 13:31:11  来源:igfitidea点击:

Develop WPF App like Windows 10 Setting App

c#.netwpfuser-interfacewindows-10

提问by Kishor

This question is just about how to develop an WPFapp with control styles exactly matching with Windows 10 Settings APP. In windows 10 setting App have different styles for combobox, toggle buttonslider controletc.

这个问题只是关于如何开发一个WPF与Windows 10 Settings APP完全匹配的控件样式的应用程序。在 Windows 10 设置应用程序有不同的样式comboboxtoggle buttonslider control等等。

windows 10 setting app

Windows 10 设置应用程序

Are these custom style available right away to use from Microsoft(.NETplatform)? Or I need to work my ass off to match these windows controls.

这些自定义样式是否可以立即从 Microsoft(.NET平台)使用?或者我需要努力去匹配这些 Windows 控件。

Or any other third party extension or tool available for the same.

或任何其他可用的第三方扩展或工具。

All the suggestions are welcome :)

欢迎所有建议:)

回答by Bart

The easiest way would be to create your apps as Windows 10 UWP apps of course.

最简单的方法当然是将您的应用程序创建为 Windows 10 UWP 应用程序。

But if you want to stick with WPF, there are several libraries already available (and you'll possible find more if you dig deep into the web). The two I know from the top of my head are:

但是如果你想坚持使用 WPF,已经有几个可用的库(如果你深入研究网络,你可能会找到更多)。我从头顶上知道的两个是:

The first one giving you more UI controls, the second one is focusing on the new Windows 10 controls like SplitViewand RelativePanel.

第一个为您提供更多 UI 控件,第二个专注于新的 Windows 10 控件,如SplitViewRelativePanel

A good place to get you started layout-wise if you want to create your own controls, is dig into the styles for these existing controls (if you installed the 8.1 and 10 SDKs).

如果您想创建自己的控件,一个让您开始布局的好地方是深入研究这些现有控件的样式(如果您安装了 8.1 和 10 SDK)。

C:\Program Files (x86)\Windows Kits\8.1\Include\winrt\xaml\design

C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.10240.0\Generic

C:\Program Files (x86)\Windows Kits\8.1\Include\winrt\xaml\design

C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.10240.0\Generic

回答by DrDynamic

For everyone who is looking for an answer to this problem. There is a NuGet package to bring the Metro Design to WPF applications: https://mahapps.com/

对于所有正在寻找此问题答案的人。有一个 NuGet 包可以将 Metro Design 引入 WPF 应用程序:https: //mahapps.com/