5 namespace SiliconStudio.Presentation.Core
15 public static readonly DependencyProperty IsFocusedProperty = DependencyProperty.RegisterAttached(
"IsFocused", typeof(
bool), typeof(
FocusManager),
new UIPropertyMetadata(
false, OnIsFocusedPropertyChanged));
24 var uiElement = obj as UIElement;
25 return uiElement != null && uiElement.IsFocused;
35 obj.SetValue(IsFocusedProperty, value);
43 private static void OnIsFocusedPropertyChanged(
DependencyObject obj, DependencyPropertyChangedEventArgs e)
45 var uiElement = (UIElement)obj;
static bool GetIsFocused(DependencyObject obj)
Gets whether the given object has currently the focus.
static void SetIsFocused(DependencyObject obj, bool value)
Gives the focus to the given object.
This class hold the IsFocusedProperty attached dependency property that allows to give the focus to a...