public void LinkControl(LinkDirection direction, UserControl linkedUserControl) { if (!dict.ContainsKey(linkedUserControl)) { AddLinkedControl(linkedUserControl); } FocusedNode.Link(direction, dict[linkedUserControl]); switch (direction) { case LinkDirection.ldRight: OnPropertyChanged("CanNavigateRight"); OnPropertyChanged("RightDirectionModelName"); break; case LinkDirection.ldLeft: OnPropertyChanged("CanNavigateLeft"); OnPropertyChanged("LeftDirectionModelName"); break; case LinkDirection.ldTop: OnPropertyChanged("CanNavigateTop"); OnPropertyChanged("TopDirectionModelName"); break; case LinkDirection.ldBottom: OnPropertyChanged("CanNavigateBottom"); OnPropertyChanged("BottomDirectionModelName"); break; default: break; } }
public void Navigate(LinkDirection direction) { var targetNode = FocusedNode.GetLinkedNode(direction); // relink TreeControl (call link back) if (FocusedNode.Control is TreeControl && !(targetNode.Control is TreeControl)) { FocusedNode.Link(LinkDirection.ldLeft, FocusedNode.GetLinkedNode(LinkDirection.ldLeft)); FocusedNode.Link(LinkDirection.ldRight, FocusedNode.GetLinkedNode(LinkDirection.ldRight)); } FocusedNode = targetNode; }