简体   繁体   English

WP7在UserControl中使用LoopingSelector

[英]WP7 using LoopingSelector in a UserControl

It seems that this should be straightforward. 看来这应该是直截了当的。 I apologize in advance if this is an amazingly stupid, but I'm just not seeing it. 如果这是一个非常愚蠢的事情,我会事先道歉,但我只是没有看到它。

I want to have a textbox tied to a user control with 2 spinners on it. 我希望有一个文本框绑定到一个用户控件上,上面有2个微调器。 Exactly how the toolkit's DatePicker works, but with custom data. 确切地说,工具包的DatePicker如何工作,但是使用自定义数据。 I can get the LoopingSelectors setup in a usercontrol, no problem. 我可以在用户控件中设置LoopingSelectors,没问题。 But for the life of me, I can't figure out how to make that pop up on click of the textbox. 但对于我的生活,我无法弄清楚如何在点击文本框时弹出。 I thought about reverse engineering the DatePicker code, but there is a lot going on in there and I don't think all that much of it applies to what I'm trying to do... I also considered the ListPicker and LongListSelector, but my data really lends itself to the LoopingSelector format. 我考虑过对DatePicker代码进行逆向工程,但是有很多内容在那里进行,我不认为它有多大适用于我正在尝试做的事情......我也考虑了ListPicker和LongListSelector,但是我的数据真的适合LoopingSelector格式。

I have scoured the web for a couple of days and found nothing of use yet. 我已经在网上搜了几天,但却一无所获。 I found some similar questions like - Implement NumericUpDown spinner control on Windows Phone 7? 我发现了一些类似的问题 - 在Windows Phone 7上实现NumericUpDown微调器控件?

But, that doesn't really address using the LoopingSelectors in a real world scenario with a user control with show/hide ability. 但是,这并没有真正解决在具有显示/隐藏功能的用户控件的真实场景中使用LoopingSelectors。

Any pointers would be much appreciated! 任何指针将非常感谢!

For a consistent user experience I'd go with the DatePicker implementation approach. 为了获得一致的用户体验,我将使用DatePicker实现方法。 I know that it involves way more work than feels sane, but I recently did exactly that for a duration picker (hours/minutes/seconds) and it just feels natural. 我知道它涉及更多的工作而不是理智,但我最近确实做了一个持续时间选择器(小时/分钟/秒),它只是感觉自然。

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

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