Menu

Best way to access main form from TasksInTabs example

Help
rtburke
2013-12-12
2013-12-13
  • rtburke

    rtburke - 2013-12-12

    Hello,
    I'm still very new to MVC# and would appreciate some help. The TasksInTabs example does more or less what I want but I am struggling with one particular aspect. If I want to update something on the main form outside the view in the TabControl how would you suggest I go about doing that? For example, the application logic might want to disable one of the tabs or to set the text in a status bar at the bottom of the form.

    Thanks in advance for any help.

     
  • OVZH

    OVZH - 2013-12-12

    Hi,

    As I undersand you want some changes happening in a child task to be propagated to the main task (specifically main form should reflect those changes).

    When you start a child task from inside your main view controller/presenter you can subscribe to any events/changes happening in this task.

    class MainViewController : ControllerBase<MainTask, IMainView>
    ...
        var t = Task.TasksManager.StartTask(typeof(TabTask2)) as TabTask2;
        t.StateChanged += (o, e) => View.DisplayStateChanged();
    

    Kind regards,
    --
    Oleg Zhukov

     

    Last edit: OVZH 2013-12-12
  • rtburke

    rtburke - 2013-12-13

    Thanks once again for your help Oleg. I will give this a try.

    Regards,
    Richard

     
  • rtburke

    rtburke - 2013-12-13

    Thanks once again for your help Oleg. I will give this a try.

    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.