简体   繁体   中英

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#.

WPF has really nice themes, but the buttons and elements are too small for touch. My designer suggest WinForms, but those look really old. Modern UI (Metro for Windows 8), well only works in Windows 8, and I don't see it as being efficient.

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'.

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.

Every control in WPF can be both templated and styled according to your needs.

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...

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!

要补充本杰明的答案,..我正在阅读.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.

  • Theme supported
  • Metro style design
  • XAML explicit in project, code downloadable from Github
  • Many new controls, such as Metro-style window , WP-Pivot , Panel-floattable with animation, etc 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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