I want to create a project template such that class name matches user provided project name.
My class is defined as (in exported ProjectTemplate):
namespace $safeprojectname$.ViewModels
{
[Export("$safeprojectname$.ViewModels.TestClassViewModel ",typeof(ContentPaneViewModel))]
[PartCreationPolicy(CreationPolicy.NonShared)]
public class TestClassViewModel : ContentPaneViewModel
{
[ImportingConstructor]
public TestClassViewModel ([Import("$safeprojectname$.Views.TestClassView")]IView theView)
{
View = theView;
View.ViewModel = this;
}
}
}
If my ProjectName is ABCProj, then I want TestClassViewModel to be created as ABCProjViewModel. TO achieve that I updated the class file in Project template as:
namespace $safeprojectname$.ViewModels
{
[Export("$safeprojectname$.ViewModels.$safeprojectname$",typeof(ContentPaneViewModel))]
[PartCreationPolicy(CreationPolicy.NonShared)]
public class $safeprojectname$: ContentPaneViewModel
{
[ImportingConstructor]
public $safeprojectname$([Import("$safeprojectname$.Views.TestClassView")]IView theView)
{
View = theView;
View.ViewModel = this;
}
}
}
Saved the changes and recreated the Project Template zip file. But when i created a project using this template, I still got classname as TestClassViewModel.
What is that I am doing wrong here?
Thanks,
RDV