Exemplo n.º 1
0
        /// <summary>
        /// Return the type of a view model bound by an IViewModelBinding
        /// </summary>
        private static Type GetViewModelType(string viewModelTypeName)
        {
            var type = TypesWithBindingAttribute
                       .FirstOrDefault(t => t.ToString() == viewModelTypeName);

            if (type == null)
            {
                throw new ViewModelNotFoundException("Could not find the specified view model \"" + viewModelTypeName + "\"");
            }

            return(type);
        }
        /// <summary>
        /// Return the type of a view model bound by an IViewModelBinding
        /// </summary>
        private static Type GetViewModelType(string viewModelTypeName)
        {
            var type = TypesWithBindingAttribute
                       .Where(t => t.Name == viewModelTypeName)
                       .FirstOrDefault();

            if (type == null)
            {
                throw new ApplicationException("Could not find the specified view model \"" + viewModelTypeName + "\"");
            }

            return(type);
        }