Search code examples
comboboxwindows-phone-7

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 the 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?


Solution

  • 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