Your template seems pretty good for a very general editor. If I understand your question correctly, you are looking for more ways to break down and filter your model properties.
One way to filter a model into subsets without creating submodels is to use attributes. You can create as many attributes as you like, and it will implement IMetadataAware . There you can add custom properties to the ModelMetadata.AdditionalValues property ModelMetadata.AdditionalValues , and your editor templates will check these values.
Alternatively, you can implement your own ModelMetadataProvider , which returns a custom ModelMetadata object that would have any properties that you would like.
Or you could simply annotate your model to determine the behavior of the filter.
Both of these methods are described by someone else, Brad Wilson, in this post.
bhamlin
source share