public void ReleaseFocus(IFocusElement element) { if (this.IsFocused(element)) { this.SetFocus(null); } }
public void SetFocus(IFocusElement element) { this.CurrentFocus?.UpdateJoystickInfo(this.lastJoystickInfo, new JoystickInfo()); this.CurrentFocus?.LostFocus(); this.CurrentFocus = element ?? this.DefaultFocus ?? throw new InvalidOperationException("CurrentFocus is null!"); this.CurrentFocus.GotFocus(); this.onScreenMenu.SetContextMenu(this.CurrentFocus.ContextMenu); }
public bool IsFocused(IFocusElement element) { return(this.CurrentFocus?.Equals(element) ?? false); }