I am creating data templates for some of my view models and all my view models share a common interface that I would like to only have to write a template for one time instead of in each view models template. How can I do that. My interface basically has a few properties in it like the name of the section, the help command, tooltip text, etc.
So each of my view models has a different view, but this is common among all of them and will be styled the same just the text is different. So how can I define that and add the things that are different instead of everything every time?
Basically I have three sections one for IIS settings one for user accounts, and one for a web config. They all have a Title, HelpCommand, and tooltip. Those three properties are in the interface, but they also have things that are different like IIS has website, virtual directory ect. and Users will have username, password, type, group, ect.
I am trying to create a datatemplate to display those sections, but don’t want to have to repeat the template for the helpcommand, title, and tooltip. Is there anyway I can make a template with that in it and extend the template to include the properties that are different for each section?
If your viewmodels already share a common interface, than making a view for this interface is no different than making a view for any specific viewmodel. You will only need to set the datacontext of the view to the instantiated viewmodel and the binding will work.
EDIT
After you clarified, I found this SO question on data template inheritance.