/// <summary> /// Updates the focus chain with cells in the tree. /// </summary> /// <param name="focusChain">The list of focusable cell views found in the tree.</param> /// <param name="focusedNode">The currently focused node.</param> /// <param name="focusedFrame">The currently focused frame in the template associated to <paramref name="focusedNode"/>.</param> /// <param name="matchingFocus">The focus in <paramref name="focusChain"/> that match <paramref name="focusedNode"/> and <paramref name="focusedFrame"/> upon return.</param> public virtual void UpdateFocusChain(FocusFocusList focusChain, Node focusedNode, IFocusFrame focusedFrame, ref IFocusFocus matchingFocus) { IFocusFocus NewFocus = CreateFocus(); focusChain.Add(NewFocus); if (focusedFrame == Frame) { IFocusOptionalNodeState AsOptionalNodeState = StateView.State as IFocusOptionalNodeState; Debug.Assert(AsOptionalNodeState == null || AsOptionalNodeState.ParentInner.IsAssigned); if (focusedNode == StateView.State.Node) { Debug.Assert(matchingFocus == null); matchingFocus = NewFocus; } } }
private protected virtual void UpdateFocusChain(IFocusNodeState state, Node focusedNode, IFocusFrame focusedFrame) { FocusFocusList NewFocusChain = CreateFocusChain(); IFocusNodeState RootState = Controller.RootState; IFocusNodeStateView RootStateView = (IFocusNodeStateView)StateViewTable[RootState]; IFocusFocus MatchingFocus = null; RootStateView.UpdateFocusChain(NewFocusChain, focusedNode, focusedFrame, ref MatchingFocus); // Ensured by all templates having at least one preferred (hence focusable) frame. Debug.Assert(NewFocusChain.Count > 0); // First run, initialize the focus to the first focusable cell. if (Focus == null) { Debug.Assert(FocusChain == null); Focus = NewFocusChain[0]; ResetCaretPosition(0, true); } else if (MatchingFocus != null) { Focus = MatchingFocus; UpdateMaxCaretPosition(); // The focus didn't change, but the content may have. } else { RecoverFocus(state, NewFocusChain); // The focus has forcibly changed. } FocusChain = NewFocusChain; DebugObjects.AddReference(NewFocusChain); Debug.Assert(Focus != null); Debug.Assert(FocusChain.Contains(Focus)); SelectionAnchor = Focus.CellView.StateView; SelectionExtension = 0; }
/// <summary> /// Updates the focus chain with cells in the tree. /// </summary> /// <param name="focusChain">The list of focusable cell views found in the tree.</param> /// <param name="focusedNode">The currently focused node.</param> /// <param name="focusedFrame">The currently focused frame in the template associated to <paramref name="focusedNode"/>.</param> /// <param name="matchingFocus">The focus in <paramref name="focusChain"/> that match <paramref name="focusedNode"/> and <paramref name="focusedFrame"/> upon return.</param> public virtual void UpdateFocusChain(IFocusFocusList focusChain, INode focusedNode, IFocusFrame focusedFrame, ref IFocusFocus matchingFocus) { foreach (IFocusCellView Item in CellViewList) { Item.UpdateFocusChain(focusChain, focusedNode, focusedFrame, ref matchingFocus); } }
/// <summary> /// Updates the focus chain with cells in the tree. /// </summary> /// <param name="focusChain">The list of focusable cell views found in the tree.</param> /// <param name="focusedNode">The currently focused node.</param> /// <param name="focusedFrame">The currently focused frame in the template associated to <paramref name="focusedNode"/>.</param> /// <param name="matchingFocus">The focus in <paramref name="focusChain"/> that match <paramref name="focusedNode"/> and <paramref name="focusedFrame"/> upon return.</param> public abstract void UpdateFocusChain(FocusFocusList focusChain, Node focusedNode, IFocusFrame focusedFrame, ref IFocusFocus matchingFocus);
/// <summary> /// Updates the focus chain with cells in the tree. /// </summary> /// <param name="focusChain">The list of focusable cell views found in the tree.</param> /// <param name="focusedNode">The currently focused node.</param> /// <param name="focusedFrame">The currently focused frame in the template associated to <paramref name="focusedNode"/>.</param> /// <param name="matchingFocus">The focus in <paramref name="focusChain"/> that match <paramref name="focusedNode"/> and <paramref name="focusedFrame"/> upon return.</param> public virtual void UpdateFocusChain(FocusFocusList focusChain, Node focusedNode, IFocusFrame focusedFrame, ref IFocusFocus matchingFocus) { Debug.Assert(RootCellView != null); RootCellView.UpdateFocusChain(focusChain, focusedNode, focusedFrame, ref matchingFocus); }
/// <summary> /// Updates the focus chain with cells in the tree. /// </summary> /// <param name="focusChain">The list of focusable cell views found in the tree.</param> /// <param name="focusedNode">The currently focused node.</param> /// <param name="focusedFrame">The currently focused frame in the template associated to <paramref name="focusedNode"/>.</param> /// <param name="matchingFocus">The focus in <paramref name="focusChain"/> that match <paramref name="focusedNode"/> and <paramref name="focusedFrame"/> upon return.</param> public virtual void UpdateFocusChain(IFocusFocusList focusChain, INode focusedNode, IFocusFrame focusedFrame, ref IFocusFocus matchingFocus) { ChildStateView.UpdateFocusChain(focusChain, focusedNode, focusedFrame, ref matchingFocus); }
bool ICollection <IFocusFocus> .Remove(IFocusFocus item) { return(Remove((ILayoutFocus)item)); }
bool ICollection <IFocusFocus> .Contains(IFocusFocus value) { return(Contains((ILayoutFocus)value)); }
void ICollection <IFocusFocus> .Add(IFocusFocus item) { Add((ILayoutFocus)item); }
void IList <IFocusFocus> .Insert(int index, IFocusFocus item) { Insert(index, (ILayoutFocus)item); }
int IList <IFocusFocus> .IndexOf(IFocusFocus value) { return(IndexOf((ILayoutFocus)value)); }
/// <summary> /// Updates the focus chain with cells in the tree. /// </summary> /// <param name="focusChain">The list of focusable cell views found in the tree.</param> /// <param name="focusedNode">The currently focused node.</param> /// <param name="focusedFrame">The currently focused frame in the template associated to <paramref name="focusedNode"/>.</param> /// <param name="matchingFocus">The focus in <paramref name="focusChain"/> that match <paramref name="focusedNode"/> and <paramref name="focusedFrame"/> upon return.</param> public virtual void UpdateFocusChain(IFocusFocusList focusChain, INode focusedNode, IFocusFrame focusedFrame, ref IFocusFocus matchingFocus) { }