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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:42:58+00:00 2026-05-10T22:42:58+00:00

I’m making a WPF application that is comprised of Screens (Presenter + View). I

  • 0

I’m making a WPF application that is comprised of Screens (Presenter + View). I want to be able to declare these screens in a config file or SQL database. I have been trying to come up with a good solution I’ve given up and am asking how some of you design this sort of thing? I’ve been working at this for over a week and every solution I come up with stinks.

In my WPF application I have a treeview that represents screens. When the user clicks on a node, the screen is loaded. I want to be able to populate the treenodes from a config file or database. The program should not care where these are stored so I can swap out a config store for a database store. If I have the screen info stored I can also use an IOC container to instantiate the screens for me and retrieve them by name. Here is a sample of the config file schema that I have come up with:

<screen name='' title='' presenterType='' viewType=''/> <screen ...>     <screen .../>     <screen .../> </screen> <screen .../> 

The latest solution I have come up with is to use a ScreenService that asks a ScreenRepository for ScreenInfo objects. Then I will be able to populate the treeview and IOC container with this information.

Does this sound like a good solution? What would you do different? And, how do you design this sort of system in your own programming?

  • 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. 2026-05-10T22:42:58+00:00Added an answer on May 10, 2026 at 10:42 pm

    When you return objects out your factory method you can include a hierarchy as well. For example my shape factories have two methods One returns a list of shapes that added to a master list, Another return Shape Libraries. While User can define and alter the actual libraries I have a default set automatically generated to use for troubleshooting and initial installation. It is hierarchical.

    However A ShapeLibrary is comprised of ShapeLibraryItem. A ShapeLibraryItem has a key stored with it so it can pull the shape out of the master program list. So a button or item is clicked, it looks at the ShapeLibrary Item it is associated with. Get the key, uses the key to get the shape program and then uses the UI Interface to draw the screen.

    IF your screen has the hierarchy info embedded as one of it’s many properties then I recommend that you separate it out into a Hierarchy Item. A HierarchyList then can be created that is comprised of HierarchyLists OR HierarchyItem. I would make a IHierarchyItem interface so that HierarchyLists look like a item.

    The main difference is behavior. When you click a HeirarchyList will bring up another list (or expand, etc) a true Item will bring up a screen.

    So your assembly will have two class marked with one of two attributes. One will be the ScreenFactory, and the other will be the HierarchyFactory.

    Note you don’t have to use keys you could directly link a HierarchyItem to the shape. I use GUID keys to avoid coupling every single time. Coupling is not always bad but it isn’t always good either. Since GUID are effectively unique it works out the same.

    As for performance you will have to hundreds of ASSEMBLIES before you notice it. Remember you don’t have to have an assembly for each screen. Just group them logically into a handful of assemblies and you are good to go.

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

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Here's two approaches, depending on whether you want to pack… May 11, 2026 at 3:36 pm
  • added an answer On Linux it surely is possible by accessing /dev/ files.… May 11, 2026 at 3:36 pm
  • added an answer I wouldn't perform the the encryption as part of the… May 11, 2026 at 3:36 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.