I have a control where is about 100 hundred TextBoxes, and I need for each of them have binded event to GotFocus event (where I select all text).
I cant use EventSetter as in WPF, so what do you use to bind event in style?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll have to subclass the
TextBoxclass and then use that in all your code.You can then put the
GotFocusevent handler in that subclass, otherwise you’d have to add theGotFocusevent handler to all your code.Then in your XAML you’d have: