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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:46:33+00:00 2026-05-14T14:46:33+00:00

I have an area on the left with selectable items, and depending on what

  • 0

I have an area on the left with selectable items, and depending on what type of item is selected, I want to show one of three or four different forms on the right.

It would be nice to make some type of control so the main form can be less of a mess.

What’s the best pattern for this in WPF?

I’m a WPF newbie, and I’ve spent some time going in some obviously incorrect directions. Thanks!

  • 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-14T14:46:33+00:00Added an answer on May 14, 2026 at 2:46 pm

    I would say, whenever possible Templates are the way to go in WPF. They define how controls or data is displayed in the UI. Using templates, it is possible to use any object (not only strings) as the content of a Button, for example. If you set the content of a Button to be an object of type MyType, WPF will look for a DataTemplate for MyType in the resources and use that one if it is found. If no DataTemplate is found, it will use the ToString() method of that object and display the result.

    In your scenario, you could use a simple ContentControl for your details view on the right and define different DataTemplates for each item type. If not every item needs a different template (i.e. some types share the same template), you could implement a ContentTemplateSelector to determine the correct DataTemplate programmatically.

    The Data Templating Overview gives a good introduction into that topic.

    HTH, good luck!

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

Sidebar

Related Questions

i have one text area <textarea name=message id=message class=text_field style=height:200px; width:500px></textarea> if i type
I have a section where I would like to customize the left area of
I have table cells with an image on the left. Now, every time one
I need to have elements that are dragged from left-hand side area to be
I have a ListView, and I want to customize the layout of each item
I have a load of divs that area ll floated left so they sit
I have an area in which I want to add two buttons inside in.
I have an area where the user can draw using a finger. This area
I have an area which is represented by constrained delaunay triangulations. I am playing
In my application I have large area (≈5000x5000pts) and I must allow user to

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.