protected ViewModelBaseWrapper GetViewModel(ViewModelConnection item)
        {
            Type type = item.ViewModelType;
            ViewModelBaseWrapper viewModel = (ViewModelBaseWrapper)_iocManager.Resolve(item.ViewModelType);

            return(viewModel);
        }
        public void OpenViewBlocking(Type VM, ContentControl control = null, Parameter parameter = null)
        {
            if (control != null)
            {
                if (control.DataContext as ViewModelBaseWrapper != null)
                {
                    (control.DataContext as ViewModelBaseWrapper).NavigatedFrom();
                }
            }

            // Get item for passed viewModel type
            ViewModelConnection item = _views.FirstOrDefault(x => x.ViewModelType == VM);

            if (item == null)
            {
                throw new Exception("View not registered.");
            }

            ContentControl view = GetView(item);

            ViewModelBaseWrapper viewModel = view.DataContext as ViewModelBaseWrapper;

            if (viewModel == null)
            {
                viewModel = GetViewModel(item);
            }

            if (control == null)
            {
                view.DataContext = viewModel;
                _content.Content = view;
            }
            else
            {
                view.DataContext = viewModel;
                control.Content  = view;
            }

            viewModel.Parameters = parameter;
            viewModel.NavigatedTo();
        }