How to create a Template for a ViewModel and View?
I was wondering if it is possible to create a template for a view model and view.
I would like to add a common structure to both, so when i add the new ViewModel
or View
it will all ready have all my common regions, fields, constructors, properties and methods.
So when i add the new Vi开发者_如何学GoewModel
or View
it will all ready have all the code i need to create it.
Note: I am not talking about ViewModelBase
or ViewBase
. I have that in place.
I've used the codeplex toolkit before, which I found pretty useful:
I'm not sure if I get you correctly, but have a look at Visual Studio Templates. If you need examples for templates have a look at MVVMLight it contains several templates for custom classes and views.
Another possibility (or rather a poor mans version) for a template would be a codesnippet.
精彩评论