Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8186981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:24:32+00:00 2026-06-07T02:24:32+00:00

I am creating data templates for some of my view models and all my

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:24:35+00:00Added an answer on June 7, 2026 at 2:24 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For an XML file I am creating I have data that contains a bullet
I have a list view that is displaying data using the gridview. This list
I'm working at creating a class that is a binary tree. I would like
I have taken over some work on an existing system that uses NVelocity templates.
I have mastered creating custom data types and adding fields with CCK. Then I
I am creating an ASPX application that collects data from the user can creates
So I am currently creating a Paint-like application for sports. You will some shapes
I have the following data that I am trying to feed into a Handlebar
I am looking to use jQuery Templates plugin for some forms I am creating
I have been given a task of creating a common Gridview component which has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.