Exemplo n.º 1
0
        public static void ActivateLastView(this IRegionManager regionManager, string regionName)
        {
            var activeViews = regionManager.Regions[regionName].ActiveViews.ToList();

            if (activeViews.Count > 0)
            {
                IRolodexView existingView = activeViews.Last() as IRolodexView;
                if (existingView != null)
                {
                    regionManager.ActivateSingleView(regionName, existingView);
                }
            }
            else
            {
                activeViews = regionManager.Regions[regionName].Views.ToList();
                if (activeViews.Count > 0)
                {
                    IRolodexView existingView = activeViews.Last() as IRolodexView;
                    if (existingView != null)
                    {
                        regionManager.ActivateSingleView(regionName, existingView);
                    }
                }
            }
        }
Exemplo n.º 2
0
 private static void ActivateSingleView(this IRegionManager regionManager, string regionName, IRolodexView existingView)
 {
     regionManager.Regions[regionName].Activate(existingView);
     var viewModel = existingView.DataContext as IRolodexViewModel;
     if (viewModel != null)
     {
         viewModel.Activated();
     }
 }
Exemplo n.º 3
0
        public static bool ActivateViewIfExists(this IRegionManager regionManager, string regionName, Type viewType)
        {
            bool         returnValue  = false;
            IRolodexView existingView = regionManager.GetView(regionName, viewType) as IRolodexView;

            if (existingView != null)
            {
                returnValue = true;
                regionManager.ActivateSingleView(regionName, existingView);
            }
            return(returnValue);
        }
Exemplo n.º 4
0
 public static void AddViewToRegion(this IRegionManager regionManager, string regionName, IRolodexView view)
 {
     regionManager.Regions[regionName].Add(view);
 }
Exemplo n.º 5
0
 public static void AddViewToRegion(this IRegionManager regionManager, string regionName, IRolodexView view)
 {
     regionManager.Regions[regionName].Add(view);
 }
Exemplo n.º 6
0
        private static void ActivateSingleView(this IRegionManager regionManager, string regionName, IRolodexView existingView)
        {
            regionManager.Regions[regionName].Activate(existingView);
            var viewModel = existingView.DataContext as IRolodexViewModel;

            if (viewModel != null)
            {
                viewModel.Activated();
            }
        }