/// <summary> /// Adds the given state to the top of the focus stack. /// </summary> public void AddFocus(State state) { if (focusState.Count > 0) GetFocusedState().OnBlur(); focusState.Add(state); state.OnFocus(); }
/// <summary> /// Adds the given state to the top of the focus stack. /// </summary> public void AddFocus(State state) { if (focusState.Count > 0) { GetFocusedState().OnBlur(); } focusState.Add(state); state.OnFocus(); }
/// <summary> /// Puts the given state on the top of the focus stack and removes all previous copies of the state from lower levels. /// If this state does not exist in the focus stack it will still be added to the top. /// </summary> public void BringToFront(State state) { State cur = GetFocusedState(); focusState.RemoveAll(i => i == state); focusState.Add(state); if (GetFocusedState() != cur) { GetFocusedState().OnBlur(); state.OnFocus(); } }