开发者

How to create a Template for a ViewModel and View?

开发者 https://www.devze.com 2023-02-22 17:30 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消