How to access ModuleController from View Presenter?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • peter shaw

    How to access ModuleController from View Presenter?

    Hi,

    I have a solution, that includs a project.
    The project have some folder, (like folder1, folder2, folder3,...).
    Inside folder there is a view and view presenter.
    Directly under project, there is modulcontroller that controls load win
    forms etc.

    In the moduleControole r I show a form like this:
    string key = "_abc";

    AForm view = this.WorkItem.I tems.Get<AForml >(key);

    if (view == null)

    {

    view = WorkItem.SmartP arts.AddNew<AFo rm>();

    }

    view.ShowDialog ();

    What I want is calling a function in the modulecontrolle r from a view
    presenter. Say this is a function call GetCustomerID(s tring a);

    Thank u.
    peter


  • Forrest

    #2
    Re: How to access ModuleControlle r from View Presenter?


    U¿ytkownik "peter shaw" <petershaw@clin icalcomputers.c om.aunapisa³ w
    wiadomo¶ci news:uo1%23d1y6 GHA.4552@TK2MSF TNGP05.phx.gbl. ..
    Hi,
    >
    I have a solution, that includs a project.
    The project have some folder, (like folder1, folder2, folder3,...).
    Inside folder there is a view and view presenter.
    Directly under project, there is modulcontroller that controls load win
    forms etc.
    >
    In the moduleControole r I show a form like this:
    string key = "_abc";
    >
    AForm view = this.WorkItem.I tems.Get<AForml >(key);
    >
    if (view == null)
    >
    {
    >
    view = WorkItem.SmartP arts.AddNew<AFo rm>();
    >
    }
    >
    view.ShowDialog ();
    >
    What I want is calling a function in the modulecontrolle r from a view
    presenter. Say this is a function call GetCustomerID(s tring a);
    >
    Thank u.
    peter
    >
    I thik you have do something like that. In your view class add this code
    [CreateNew]

    public ClassPresenter Presenter

    {

    get { return _presenter; }

    set

    {

    _presenter = value;

    _presenter.View = this;

    }

    }

    and then if you want to call some methods from your WorkItem class from view
    class then you can do that like this Presenter.WorkI tem. (you hev access to
    all public methods in workItem class)

    I think you use a UIApplicationBl ock am I right?

    Forrest


    Comment

    Working...