public virtual T CreateVm(K element) { var vm = Activator.CreateInstance(typeof(T), element) as T; RepositoryService.AddViewModel(vm); return(vm); }