Quantcast
Viewing all articles
Browse latest Browse all 18858

Enter key navigation

Hi,

I wanted to use Enter key Navigation and I could do that using the below code which I found from a site when googled. 

Can any one please give me an explanation of this code. Enter key navigation works fine using the code but I would like to know how it works using the below code.

if (e.Key == Key.Return)
            {
                UIElement focusedElement = Keyboard.FocusedElement as UIElement;

                if (focusedElement != null)
                {
                    focusedElement.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
                }

                e.Handled = true;
            }

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>