Hi,
I am trying to inherit xamTextEditor. In my derived class, I have to set IsKeyboardFocused =True in GotFocus and IsKeyboardFocused =False in LostFocus. But as IsKeyboardFocus property has only the getter, I am not able to set it.
How to handle this problem.
Thanks
Seema
Thanks Anastas,
I have tried with this solution and it solved my problem.
Actually the focus is in TextBox inside the xamTextEditor. So you have to use IsKeyboardFocusWithin property.
If you invoke Keyboard.FocusedElement you will see that focused element actually is the textBox placed inside the xamTextEditor.
Hope this helps.
Anastas
Even if element has keyboard focus,
private void MyTextBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
// IsKeyboardFocused is getting as false
}
IsKeyboardFocused will remains as false. it should be set as True.
In which event, it will get IsKeyboardFocused =True
This is not an issue. This property is inherited from UIElement class(http://msdn.microsoft.com/en-us/library/system.windows.uielement.aspx), and it's readonly.