开发者

How to implement the standard Windows Phone 7 ComboBox replacement UI

I'm trying to implement what seems to be the standard UI replacement for comboboxes in Windows Phone 7. This is the TextBox + Navigate to New Page with Listbox approach you can see in the settings page of the Emulator.

I got the following issues while trying to implement this approach, speficically related to th开发者_运维百科e TextBox:

  1. If I use a ReadOnly TextBox the text appears in light gray, which is not really what I want. I want the normal black font there.
  2. If I don't use a ReadOnly TextBox the virtual phone keyboard will appear in some rare situtations, even when I handled the MouseEnter event. I can't consistently reproduce the situations when the keyboard appears.

Which is the best approach to implement this behaviour?


The Windows Phone Toolkit has a ListPicker that is quite flexible and easy to use.


Have you considered just using a TextBlock with an invisible button over the top? Or associate a gesture to take the tap event?

You could also check out Alex's implementation here of a picker box.

Implementing Picker Box functionality on WP7. - Alex Yakhnin's Blog

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜