// -----------------------------------------------------------------------
//
// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Input.Navigation
{
///
/// Provides extension methods relating to control focus.
///
internal static class FocusExtensions
{
///
/// Checks if the specified element can be focused.
///
/// The element.
/// True if the element can be focused.
public static bool CanFocus(this IInputElement e) => e.Focusable && e.IsEnabledCore && e.IsVisible;
///
/// Checks if descendents of the specified element can be focused.
///
/// The element.
/// True if descendents of the element can be focused.
public static bool CanFocusDescendents(this IInputElement e) => e.IsEnabledCore && e.IsVisible;
}
}