简体   繁体   English

WPF的ListPicker?

[英]ListPicker for WPF?

I'm developing a touch screen kiosk application in WPF. 我正在WPF中开发触摸屏信息亭应用程序。 I'm leveraging the Microsoft Surface controls to make the application more touchscreen friendly, but I have yet to find a good replacement for the ComboBox - which seems to be one of the only options to pick a single value from a list, while using little screen real estate. 我正在利用Microsoft Surface控件使应用程序对触摸屏更友好,但是我还没有找到ComboBox的良好替代品-ComboBox似乎是从列表中选择单个值的唯一选择之一,而很少使用屏幕房地产。

The Windows Phone 7 toolkit, in Silverlight, has a ListPicker, which is more or less exactly what I'm looking for, but as I understand it, since it's in Silverlight, I can't use it in my WPF app. Silverlight中的Windows Phone 7工具包具有一个ListPicker,它或多或少正是我在寻找的东西,但是据我了解,由于它在Silverlight中,因此无法在WPF应用程序中使用它。

Before I try to build one from scratch, does anyone know of a ListPicker type control for WPF? 在尝试从头开始构建一个控件之前,有人知道WPF的ListPicker类型控件吗?

Barring that, anyone have any preferred alternatives to the standard ComboBox for a touchscreen application in WPF? 除非有人为WPF中的触摸屏应用程序提供标准ComboBox的任何替代方案?

EDIT: To clarify, I know that WPF has a ComboBox, but this is not an ideal control for touch screen use. 编辑:澄清一下,我知道WPF有一个ComboBox,但这不是触摸屏使用的理想控件。 If you look at most phone or kiosk applications, ComboBox controls are avoided where possible. 如果您查看大多数电话或信息亭应用程序,则尽可能避免使用ComboBox控件。 This is why I brought up the ListPicker (see here http://blogs.msdn.com/b/delay/archive/2010/11/03/listpicker-i-hardly-even-know-er-a-detailed-overview-of-the-windows-phone-toolkit-s-listpicker-control.aspx ), because it is a more touch-friendly control for this situation. 这就是为什么我提出ListPicker的原因(请参阅此处http://blogs.msdn.com/b/delay/archive/2010/11/03/listpicker-i-hardly-even-know-er-a-detailed-overview -windows-phone-toolkit-s-listpicker-control.aspx ),因为它是在这种情况下更易于触摸的控件。

Did you try styling ListBox? 您是否尝试过设置ListBox的样式?

I think all you need to do is to remove the ScrollViewer (that can be done by using a custom ControlTemplate). 我认为您需要做的就是删除ScrollViewer(可以通过使用自定义ControlTemplate来完成)。

Here is a quick tutorial how to do that . 这是一个快速的教程如何做到这一点

Here you can find the default template which you need to modify. 在这里,您可以找到需要修改的默认模板 Don't get scared by its size - the modifications should be quite simple. 不要害怕它的大小-修改应该非常简单。

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

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