I need to do some logic but only from a specific textbox. Trying to do some search it appears that there is no event for KeyDown or PreviewKeyUp for a textbox but for the entire window. So in XAML I have this
PreviewKeyUp="keyPressLogic" Then have a method that looks like this;
private void keyPressLogic(object sender, KeyEventArgs e) { if ((e.Key == Key.Down) && (check focus command ) ) { //My logic return; } } As you can see I cannot figure out the check focus command. So either I am missing the key check on the textbox or got to find the focus command
thanks
(sender as TextBox).IsFocused