Menu

TasksInTabs example

Help
rtburke
2013-12-06
2013-12-06
  • rtburke

    rtburke - 2013-12-06

    Hello,

    I am new to MVC# and am trying to extend the TasksInTabs example. I am struggling to understand how the Application layer (TabTask1 for example) can communicate with the view (for example to change the text on the label).

    I realise this is probably a very simple question but any help is appreciated.

    Thanks

     
  • OVZH

    OVZH - 2013-12-06

    Hi,

    In MVC/MVP patterns it's usually controllers/presenters who initiate changes in UI (in other words they control their views).

    So I recommend that your Task sends a message to the controller which then would access its view. Here's an example how a task can access a controller:

    this.Navigator.GetController(TabTask1.View2);
    

    In particular you can access the current view:

    this.Navigator.GetController(this.CurrViewName);
    

    Make sure to initialize the view before accessing it. If the view hasn't been displayed or created yet, accessing it may result in an exception.

    Kind Regards,
    --
    Oleg Zhukov

     
  • rtburke

    rtburke - 2013-12-06

    Hi Oleg,

    Thanks for your prompt response. I understood the basic principle just not how to implement it!

    Regards,
    Richard

     

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.