private object GetInstance()
        {
            if (String.IsNullOrWhiteSpace(_targetType))
            {
                return(null);
            }

            Type viewModelType = Type.GetType(_targetType);

            if (viewModelType == null)
            {
                return(null);
            }


            string tokenString = _isInDesignMode ? _designModeToken : _runTimeToken;
            object viewModel   = null;

            if (tokenString != null)
            {
                _iocRegistry.TryResolveNamed(tokenString, viewModelType, out viewModel);
            }
            else
            {
                _iocRegistry.TryResolveKeyed(_isInDesignMode ? OperatingMode.DesignMode : OperatingMode.RunTimeMode, viewModelType, out viewModel);
            }

            return(viewModel);
        }