/// <summary>
 /// Merge internal
 /// </summary>
 private static void MergeInternal(ViewModelDescription victim, ViewModelDescription merged)
 {
     foreach (var td in victim.Model)
     {
         var mergeModel = merged.Model.FirstOrDefault(o => o.TypeName == td.TypeName);
         if (mergeModel == null)
         {
             merged.Model.Add(td);
         }
         else
         {
             MergeInternal(td, mergeModel);
         }
     }
 }
        /// <summary>
        /// Merge several view model descriptions into one
        /// </summary>
        public static ViewModelDescription Merge(IEnumerable <ViewModelDescription> viewModels)
        {
            ViewModelDescription retVal = null;

            foreach (var itm in viewModels)
            {
                if (retVal == null)
                {
                    retVal = itm;
                }
                else
                {
                    MergeInternal(itm, retVal);
                }
            }

            return(retVal);
        }