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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:33:53+00:00 2026-05-16T15:33:53+00:00

I will be starting a new project soon and am looking for some architectural

  • 0

I will be starting a new project soon and am looking for some architectural advice from those of you who have experience with WPF, Prism, and MVVM.

The project will definitely be WPF and I will be implementing MVVM (I will likely use Josh Smith’s MVVM Foundation as a starting point) in order to be able to benefit from the separation of UI/logic etc. I am not sure though if I would benefit from using Prism as well to structure my project.

Let me briefly describe the project. There will be a main “toolbar” that will display a number of widgets. Each widget displays some basic data related to its function and clicking the widget will open a new window that will display much more detailed data and contain a rich UI for viewing/editing the data.

Now, I was thinking that I can use Prism to frame the project but I have never used it before and am not sure if it is suitable for what I am trying to achieve. For example, would my “toolbar” be a shell that contains regions that each widget would populate? Would each new window that is displayed when a widget is clicked also be its own shell with its own region setup? If I can get the pattern down for the toolbar and one widget on the toolbar, I can replicate it for the rest of the widgets.

Aside from Prism, I have a question about how MVVM should be implemented for certain data editing windows. Let’s say I have a chart that displays some data and the user is able to directly click/mouse move on the chart to edit the data that he sees. All of the data is in the model and the view model is making that data available to the view via binding. My question is where will the mouse click/move events, that are specific to the chart in that view, be written? We don’t want much/anything in the view’s code behind and we don’t want to have UI event handlers in the view model so I am not sure how this type of scenario is handled. I know that commands are the likely answer here but the MVVM samples I have seen usually show sample commands for simple button clicks. Is the general idea the same?

So, if anyone has any suggestions on the above or any general tips on working with WPF and MVVM/Prism, please let me know.

Thank you.

  • 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-16T15:33:53+00:00Added an answer on May 16, 2026 at 3:33 pm

    There are a few questions in there so I will do my best at covering them all.

    I worked on a project that had WPF, MVVM, and Prism along side other frameworks. The best advice is to understand the power and functionality of each before glueing it all together. You don’t have to use all the features of Prism for it to be useful in this situation.

    For Prism you can use…

    1. Shell and bootstrapper to initialise the application and load modules from other assemblies.
    2. Create and configure Unity for Dependency Injection. You can use other DI Containers. Here you can add global services each module will use.
    3. Use of EventAggregator to notify differnent parts of the application, usually across modules and views
    4. Regions for naming areas on the UI so modules can add a view to a particular location.

    The above 4 don’t all have to be used but can easily be integrated in a MVVM /WPF application.

    For example, would my “toolbar” be a
    shell that contains regions that each
    widget would populate?

    Here you can have a region you create (you can derive from Region) that will manage the buttons on the toolbar. (I have used a region with regards to a Ribbon). A service can be exposed via an interface that each module can supply the command/image (what ever you have) that when it is clicked will create a ViewModel. You can do this inside the module’s Initialisation.

    Would each new window that is
    displayed when a widget is clicked
    also be its own shell with its own
    region setup?

    If each button opens a brand new window I would suggest introducing a common controller class that will create a generic use window and attach a view model that your module creates. No real need to use regions in this case unless you are gluing different views to a application window that stays open longer than the life of the view itself. The window in basic form can simply be this…

    <Window ...>
      <ContentControl Content="{Binding}" />
    </Window> 
    

    Where within your controller it can do this…

    public void DisplayView(ViewModel vm)
    {
       var window = new MyWindow { DataContext = vm };
       window.Show();
    }
    

    The controller can be used within your module directly of wrapped within a service… although for testabilty a service and interface would be best. Make sure you have merged your module resources with the Applicaiton.Resources and use DataTemplate‘s to link your view to the view model.

    My question is where will the mouse
    click/move events, that are specific
    to the chart in that view, be written?

    Don’t be afraid of code behind but you can in this case use EventToCommand attached behaviour that will route to a command on your viewmodel. MVVMLight toolkit has this which you can reuse if you want.

    DI is very powerful and I encourage using it even without Prism as constructing your view models will be easier.

    HTH

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

Sidebar

Related Questions

I will be starting a simple datastore-and-search project soon. Basically, one of those put
I will soon be starting on a new web project that consists of 2
I'm starting a new project which in simple terms will have a UI layer
I am starting a project for which we will have a thin client, sending
I am starting a WPF project, which will be fairly complicated in complexity and
When you are starting a new project from scratch using DDD, and still isn't
I'm starting a personal project, so I have at the moment complete architectural/design control.
I'm currently starting a new project that will display user distrubuted data links in
I'm thinking about starting a new project using EF 4 and going through some
I am starting a new project and I need some very pretty controls. The

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.