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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:22:21+00:00 2026-06-01T05:22:21+00:00

Alright, so I’m attempting my hand at some pattern programming in my effort to

  • 0

Alright, so I’m attempting my hand at some pattern programming in my effort to further my skill set. I am converting a Win Forms application to WPF utilizing the MVVM pattern. The application is basically a GUI for a mainframe session. It navigates through various panels on the mainframe screen grabbing data for eventual editing and updating.
I believe I have grasped the core concepts of MVVM per below, but have a question.

I have built (exhausting with 100 or so data points) a data MODEL that represents all properties of the object I will be manipulating. I have also created proxy properties on the VIEWMODEL which implements INPC for binding on the VIEW. Now from what I have read, the business logic to grab the data should be the responsibility of the MODEL. The VIEWMODEL cleans that data up and presents it to the VIEW where it is finally displayed.

So this all seems to be functioning but here is the issue:

[SKIP TO HERE FOR THE QUESTION]

If the MODEL controls the business logic and pulls the data from the mainframe session over a series of different panels, how do I continue to update the VIEW through the VIEWMODEL as to what point the data pull is at. In essence a sort of progress indicator of the MODEL getting the data. I know I can call a method on the MODEL then report back, but how do I call the method and report back during the methods progress without the MODEL knowing of the existence of the VIEWMODEL. This is of course without implementing INPC directly on the MODEL.

Thanks for any help,

Aaron Van

  • 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-01T05:22:22+00:00Added an answer on June 1, 2026 at 5:22 am

    If you are using a background thread, you might use a BackgroundWorker and use the ProgressChanged event to report progress back to the ViewModel. Since that is really an implementation detail you might design your model with a rich event model.

    One way:

    public enum MainframeLoadStage { StageOne, StageTwo, StageThree }
    
    public class LoadingStageEventArgs : EventArgs {
         public MainframeLoadStage { get; set; }
    }
    
    class MyMainframeModel {
         public event EventHandler<LoadingStageEventArgs> StageLoaded;
    }
    

    Or if you need fine grained data per “stage” of your loading:

    public class MyMainframeModel {
        public event EventHandler<LoadingStageOneEventArgs> StageOneLoaded;
        public event EventHandler<LoadingStageTwoEventArgs> StageTwoLoaded;
    }
    

    Alternately, if you want, you can report status back for a single operation on the model by passing in a callback along with the invocation:

    public class MyMainframeModel {
        public void Load (Action<LoadingMessage> callback);
    }
    

    Even further, you could think about using Task Parallel Library (TPL) and use the featureset from there: http://msdn.microsoft.com/en-us/library/dd537609.aspx

    The role of your ViewModel in all this is of course to translate these events from your model into whatever form works best for the UI (usually through INPC, as you stated).

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

Sidebar

Related Questions

Alright, I have a really basic QStandardItemModel , filled with some numbers. I managed
Alright y'all. I am attempting to write a bit of code that places typographic
Alright, here's what I'm trying to do. I'm attempting to write a quick build
Alright, so I'm new to Android programming, so far my experience has been quite
Alright here is what I am attempting to do. I have a form written
Alright I'm pretty new to programming and stuff and I'm now trying to code
Alright. I'm attempting to complete a school assignment and cannot for the life of
Alright, I'm extremely new to programming so odds are this is a really easy
Alright I am trying to set up an OAuth Provider in PHP, but I
Alright, I'm not sure if this question has been asked before so if it

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.