Menu

Showdialog() equivalent in MVC#

Help
2011-09-15
2013-04-26
  • Diamond 2016

    Diamond 2016 - 2011-09-15

    Hi

    I have just started building a Winform application using MVC#.

    Can anyone please tell what's the showdialog() equivalent in MVC#

     
  • OVZH

    OVZH - 2011-09-16

    Hi, imadiamond2016

    You are free to use any standard C#/.NET dialogs. For example

        MessageBox.Show("Text Here").

    BUT remember about the MVP three-tier paradigm. That means the Controller class should have the UI-independent logic for notifying user. And the associated View class - in its turn - should use UI-specific classes like MessageBox:

    class MyController : ControllerBase<MyTask, IMyView>
    {
        void MyOperation()
        {
            …
            View.NotifyUser();
        }
    }

    class MainView : Form, IMyView
    {
        public void NotifyUser()
        {
            MessageBox.Show("Operation complete!");
        }
    }

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.