KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there any way to tell whether a control (specifically a System.Windows.Controls.TextBox) is focused in Silverlight? I'm looking for something like the following (what you would see in a regular .Net application): textBox.Focused This seems like something simple and trivial to leave out from a control, and yet I can't find an answer anywhere. Update A slightly more elegant solution, incorporating Rob's answer, is to create an extension method like so: public static bool IsFocused( this Control control ) { return FocusManager.GetFocusedElement() == control; }
Tags (comma-separated)
Save Edits
Cancel