示例#1
0
 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();
 }
示例#2
0
 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);
 }
示例#3
0
 private void ActivateView(UserControlView view)
 {
     viewActivatedInCode = true;
     rootControl.SetView(view);
     viewActivatedInCode = false;
 }
示例#4
0
 private void PopulateParentFocusedViews(UserControlView focusedView)
 {
     parentFocusedViews.Clear();
     UserControlView nextParent = GetParentView(focusedView);
     while (nextParent != null)
     {
         parentFocusedViews.Add(nextParent);
         nextParent = GetParentView(nextParent);
     }
 }
示例#5
0
 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;
 }