public void SetView(UserControlView view) { if (view.Parent == null) ContentPanel.Children.Add(view); if (view.Parent == ContentPanel) Canvas.SetZIndex(view, TopZIndex); view.Visibility = Visibility.Visible; view.Focus(); }
protected virtual void InitializeView(UserControlView view) { views[view.ViewName] = view; view.Controller = Navigator.GetController(view.ViewName); if (view.Controller != null) view.Controller.View = view; view.GotFocus += new RoutedEventHandler(view_GotFocus); NotifyOnInitialization(view); InitializeChildViews(view.ContentElement); }
private void ActivateView(UserControlView view) { viewActivatedInCode = true; rootControl.SetView(view); viewActivatedInCode = false; }
private void PopulateParentFocusedViews(UserControlView focusedView) { parentFocusedViews.Clear(); UserControlView nextParent = GetParentView(focusedView); while (nextParent != null) { parentFocusedViews.Add(nextParent); nextParent = GetParentView(nextParent); } }
private UserControlView GetParentView(UserControlView view) { FrameworkElement nextParent = view.Parent as FrameworkElement; while (nextParent != null) { if (nextParent is UserControlView) return nextParent as UserControlView; nextParent = nextParent.Parent as FrameworkElement; } return null; }