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 wo
As soon as you have a control consisting of more than one input element (which needs to have focus for handling user input) asking the FocusManager won't do the trick anymore. Try this:
private bool HasFocus { get; set; }
protected override void OnGotFocus( RoutedEventArgs e )
{
base.OnGotFocus( e );
HasFocus = true;
}
protected override void OnLostFocus( RoutedEventArgs e )
{
base.OnLostFocus( e );
HasFocus = false;
}