Beispiel #1
0
 public static void Navigate(
     Destination destination,
     ExistingViewBehavior existingViewBehavior = ExistingViewBehavior.Remove,
     params object[] parameters)
 {
     Navigate(NavigationFactory.GetNavigationItem(destination), existingViewBehavior, null, parameters);
 }
Beispiel #2
0
        public static void NavigateToPopUp(
            Destination destination,
            ExistingViewBehavior existingViewBehavior = ExistingViewBehavior.Remove,
            params object[] parameters)
        {
            var navigationItem = NavigationFactory.GetNavigationItem(destination);

            navigationItem.Parameters = parameters;
            var viewModel = Container.ResolveViewModel(navigationItem.ViewModelType);

            viewModel.Initialize(parameters);
            var view = Container.ResolveView(navigationItem.ViewType);

            view.DataContext            = viewModel;
            ShellView.ChildPopup.IsOpen = false;
            var resolution = Window.Current.Bounds;
            var height     = resolution.Height;
            var width      = resolution.Width;

            ShellView.ChildPopup.Child            = (UIElement)view;
            ShellView.ChildPopup.Visibility       = Visibility.Visible;
            ShellView.ChildPopup.VerticalOffset   = height - 464;
            ShellView.ChildPopup.MaxHeight        = (height / 2);
            ShellView.ChildPopup.MaxWidth         = width;
            ShellView.ChildPopup.HorizontalOffset = 0;
            ShellView.ChildPopup.IsOpen           = true;
            ShellView.UseSunGlasses(true);
        }
Beispiel #3
0
        private static void Navigate(
            INavigationItem navigationItem,
            ExistingViewBehavior existingViewBehavior,
            EventHandler callBack,
            params object[] parameters
            )
        {
            if (parameters.Length > 0)
            {
            }
            var viewModel = Container.ResolveViewModel(navigationItem.ViewModelType);
            var view      = Container.ResolveView(navigationItem.ViewType);
            var grid      = FindGrid(_shell, navigationItem.RegionName);

            SetAppBar(viewModel);
            if (existingViewBehavior == ExistingViewBehavior.Remove)
            {
                grid.Children.Clear();
            }
            else
            {
                foreach (var child in grid.Children)
                {
                    child.Visibility = Visibility.Collapsed;
                }
            }
            if (callBack != null)
            {
                callBack(null, EventArgs.Empty);
            }
            grid.Children.Add((UIElement)view);
            viewModel.Initialize(parameters);
            view.DataContext = viewModel;
        }