简体   繁体   English

适用于C#的Windows桌面应用程序的基于现代触摸的UI?

[英]Modern Touch Based UI for Windows Desktop App on C#?

The title says it all, but from my searches I have not seen any UI that is both desktop friendly as well as touch based friendly on Windows using C#. 标题说明了所有内容,但是从我的搜索中,我没有看到使用C#在Windows上既台式机友好又基于触摸的UI。

WPF has really nice themes, but the buttons and elements are too small for touch. WPF确实有很好的主题,但是按钮和元素太小了,无法触摸。 My designer suggest WinForms, but those look really old. 我的设计师建议使用WinForms,但这些看上去确实很老。 Modern UI (Metro for Windows 8), well only works in Windows 8, and I don't see it as being efficient. 现代UI(适用于Windows 8的Metro)仅适用于Windows 8,但我认为它效率不高。

Are there other options? 还有其他选择吗?

One of the huge benefits of WPF as a UI technology is that it is completely customizable in terms of look and feel, each control is 'lookless'. WPF作为UI技术的巨大好处之一是,它在外观和感觉上是完全可自定义的,每个控件都是“看不见的”。

I have developed a number of touch applications that also need to work on desktop machines and WPF has proved to be a lovely solution. 我已经开发了许多需要在台式机上运行的触摸应用程序,并且WPF被证明是一个不错的解决方案。

Every control in WPF can be both templated and styled according to your needs. WPF中的每个控件都可以根据您的需要进行模板化和样式化。

Making a button a little bigger is literally the "tip of the iceberg" as such and WPF is infinitely more powerful than simply making a button appear larger however here is a simple example... 因此,将按钮稍大一点实际上就是“冰山一角”,WPF的功能比简单地使按钮看起来更大而强大得多,但这是一个简单的示例...

Disclaimer: You would not make a button this hideous in the real world ;) Example only... 免责声明:您不会在现实世界中使按钮如此丑陋;)仅示例...

<Style TargetType="{x:Type Button}">
    <Setter Property="Padding" Value="40"/>
    <Setter Property="Height" Value="200"/>
    <Setter Property="Width" Value="400"/>
</Style>

Take a look into.. Resources, Resource Dictionaries, Styles, Templates. 看一看。资源,资源字典,样式,模板。

One of the nice things I have done in the past is swap out application resource dictionaries based on whether touch capability is needed based on say a parameter, this means you can style the app according to the requirement of touch and optimize the UI accordingly! 我过去做过的一件好事是根据是否需要触摸功能(根据参数)交换应用程序资源字典,这意味着您可以根据触摸的需求对应用程序进行样式设置并相应地优化UI!

要补充本杰明的答案,..我正在阅读.NET 4.5中C#Windows Presentation Foundation中的Pro WPF 4.5,其中详细介绍了如何使WPF控件看起来像您想要的那样。

There's a library MahApps which is writing by C# and based on WPF. 有一个库MahApps ,它是用C#编写并基于WPF编写的。

  • Theme supported 支持主题
  • Metro style design 地铁风格设计
  • XAML explicit in project, code downloadable from Github XAML在项目中是显式的,可从Github下载代码
  • Many new controls, such as Metro-style window , WP-Pivot , Panel-floattable with animation, etc 许多新控件,例如Metro风格的窗口WP-PivotPanel-floattable with animation等 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM