We may encounter such a situation on the web, that is, when you modify the value of a text (such as input type = "text" in HTML), when the text is focused, all the text is selected to facilitate modification without the need to delete and modify it one by one.
Similarly, we can apply it to the textbox of WP7. We can create a custom behavior to Control. When the textbox is attached with this row, when the textbox is focused, all text in textbox is selected. If you are confused about how to create custom behaviors, refer to the two articlesArticleCreate a custom behavior and use it in a Silverlight project, and create a custom behavior and use it in a Silverlight project.
I onlyCodeAfter you paste it out, we will not describe it in detail step by step. You can use Visual Studio 2010 or expression blend to create an action. The above two articles describe it.
Textboxselectallonfocusbehavior. CS code
If you use vs to create a behavior, do not forget to add a namespace when calling the behavior. For details, refer to the followingSource code. Let's take a look at the running effect.
Source code download:
Reference
Http://mark.monsterconsultancy.nl/2011/04/13/silverlight--windows-phone-7-behavior-to-enhance-usability-of-textboxes? Utm_source = feedburner & utm_medium = feed & utm_campaign = feed: + markmonster + (Mark + monster)