// ----------------------------------------------------------------------- // // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Input { /// /// Defines attached properties that control keyboard navigation behaviour for a container. /// public static class KeyboardNavigation { /// /// Defines the TabNavigation attached property. /// /// /// The TabNavigation attached property defines how pressing the Tab key causes focus to /// be navigated between the children of the container. /// public static readonly PerspexProperty TabNavigationProperty = PerspexProperty.RegisterAttached("TabNavigation", typeof(KeyboardNavigation)); /// /// Defines the TabOnceActiveElement attached property. /// /// /// When focus enters a container which has its /// attached property set to , this property /// defines to which child the focus should move. /// public static readonly PerspexProperty TabOnceActiveElementProperty = PerspexProperty.RegisterAttached("TabOnceActiveElement", typeof(KeyboardNavigation)); /// /// Gets the for a container. /// /// The container. /// The for the container. public static KeyboardNavigationMode GetTabNavigation(InputElement element) { return element.GetValue(TabNavigationProperty); } /// /// Sets the for a container. /// /// The container. /// The for the container. public static void SetTabNavigation(InputElement element, KeyboardNavigationMode value) { element.SetValue(TabNavigationProperty, value); } /// /// Gets the for a container. /// /// The container. /// The active element for the container. public static IInputElement GetTabOnceActiveElement(InputElement element) { return element.GetValue(TabOnceActiveElementProperty); } /// /// Sets the for a container. /// /// The container. /// The active element for the container. public static void SetTabOnceActiveElement(InputElement element, IInputElement value) { element.SetValue(TabOnceActiveElementProperty, value); } } }