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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:23:27+00:00 2026-06-11T16:23:27+00:00

Using a MVP Pattern in a WinForms app I have been asked to write.

  • 0

Using a MVP Pattern in a WinForms app I have been asked to write. Pardon VB.net as I am being forced to use this 🙁

Being New to MVP I have gone with a Passive Model implementation where there is no dependency between the View & the Model and only the Presenter knows both

The View being a representation of the UI what functionality should be part of the IVIEW interface

Should I have the methods/actions/tasks in the IView i.e

 Property QItems As IList(Of QItem)
    Property SelectedQItem As QItem

    Property QueStatus As QueStatus

    Property ReportName As String
    Property ScheduleName As String

    Sub BuildQItems()

    Sub RunQue()

    Sub StopQue()

    Sub CancelCurrent()

    Sub PauseCurrent()

and make the calls view the Iview Interface that is implemented in the winform

class Winform 
   implements IView


 Private Sub btnCreate_Click(sender As System.Object, e As System.EventArgs) Handles btnCreate.Click Implements IVIEW.Create
    If (_presenter.CreateSchdule()) Then
        MessageBox.Show("Sucessfully Created")
        Close()
    End If
End Sub

End Class

or Should I just hold the state

 Property QItems As IList(Of QItem)
    Property SelectedQItem As QItem

    Property QueStatus As QueStatus

    Property ReportName As String
    Property ScheduleName As String

And make the calls directly to the Presenter which is part of the WinForm and not bother about the Iview intreface

i.e

_presenter.BuildItems()

_presenter.RunQue()

How do you weigh up when to do either approach when using MVP ?

  • 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-11T16:23:28+00:00Added an answer on June 11, 2026 at 4:23 pm

    If you are referring to the passive view approach then you should not try to call the presenter or to write business logic inside the view. Instead, the view should create an instance of the presenter passing a reference of itself. Login form example:

    public LoginView() // the Form constructor
    {
       m_loginPresenter = new LoginPresenter(this);
    }
    
    public void ShowLoginFailedMessage(string message)
    {
       lblLoginResult.Text = message;
    }
    

    The View interface should contain properties that allow the presenter to present business objects to the view as well as to manage the UI state (indirectly). Ex:

    interface ILoginView
    {
       event Action AuthenticateUser;
       string Username { get; }
       string Password { get; }
       string LoginResultMessage { set; }
    }
    

    The presenter would be something like:

    public LoginPresenter(ILoginView view)
    {
       m_view = view;
       m_view.AuthenticateUser += new Action(AuthenticateUser);
    }
    
    private void AuthenticateUser()
    {
       string username = m_view.Username;
       ...
       m_view.ShowLoginResultMessage = "Login failed...";
    }
    

    Sorry about the C# code but I haven’t touched VB.NET for a while now.

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

Sidebar

Related Questions

I have been playing around with the MVP pattern using winforms for the last
We've been using the MVP pattern and Winforms with a fair amount of success.
I'm developing an asp.net (classic) application trying to implement the MVP pattern using this
We are trying to use the MVP pattern in our current project (asp.net app)
I've been using MVP pattern in my application. But I have problems with testing
I am working on an ASP.NET WebForm application using MVP pattern. For every Web
I am using the MVP design pattern and I have registered my presenter as
When applying the MVP pattern to ASP.NET applications, where does using AJAX to post
I'm working on an ASP.NET webapp using the MVP pattern, and as I'm organizing
Using GWT with the MVP pattern , I'd like to have a place that

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.