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 6668623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:03:40+00:00 2026-05-26T03:03:40+00:00

Assume I have several Views in my WPF application that all show a report,

  • 0

Assume I have several Views in my WPF application that all show a report, but each View shows a different report.
I created a base ViewModel that contains all the stuff all reports have in common. Each report View gets its own ViewModel that is derived from the base ViewModel. These derived ViewModels have the following responsibilities:

  1. Generate the Report Data
  2. Format the Report Data for printing
  3. Provide properties for the report parameters
  4. Provide Commands for additional actions that can be executed on the generated report (optional)

That’s all fine and concise, however, the Views are a complete mess.
Basically, each View is the same with only some minor changes, for example:

  1. Provide different controls for the report parameters
  2. Provide buttons that bind to the Commands for the additional actions

I would like to achieve the following:

  1. Have a base View that defines all the stuff all report Views have in common, similar to a Site.master in ASP.NET. This would contain the search button, the print button, the grid the report is shown in etc…
  2. Have concrete Views – one for each report – that defines only the controls for the search parameters and the buttons for the additional actions

How to do this? Googling for WPF master page brings up a lot of custom made solutions – surely there must be a standard way?

  • 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-05-26T03:03:41+00:00Added an answer on May 26, 2026 at 3:03 am

    In WPF, a placeholder ContentControl.ContentTemplate can be set automatically based on its DataTemplate.DataType if the Content is set to that same DataType instance.

    http://www.japf.fr/2009/03/thinking-with-mvvm-data-templates-contentcontrol/

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

Sidebar

Related Questions

I have a 'master' branch and several topic branches. Assume that the master branch
I have several classes which use static variables. I assume that the classes are
I have set up several Views each containing a UIPickerView each of which contains
Assume I have 3 Models: City, Area, Entry. Each city has several Areas and
I have a tab based application. On the first tab I have several views
Lets assume I have several <span class='remove-type'> elements on a page. In jQuery document.ready
We have several sites that use Forms Based authentication (FBA) within SharePoint. Many of
I have an app that uses several prefixes and, while not frequent, it's also
I have several classes that need to load some properties files, and I was
I have several Facebook like buttons on myself that are being rendered via XFBML.

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.