Link to home
Start Free TrialLog in
Avatar of FrancineTaylor
FrancineTaylor

asked on

trying to store a pointer to my presenter in view class

Here's my presenter class:

public class ListPresenter<TViewInterface, TContext> : Presenter<TViewInterface, TContext>
            where TViewInterface : IContextView<TContext>, IListView
            where TContext : IObservableObject
{
     protected override void OnInitializePresentationComplete(dynamic data)
     {
      View.ViewPresenter = (ListPresenter<TViewInterface, TContext>)this;
     }
}

Here's how I am defining the property in the view:

public ListPresenter<IListView, IObservableObject> ViewPresenter { get; set; }

The compile time exception showing on the ViewPresenter property is "The type IListView cannot be used as type parameter TViewInterface in the generic type or method ListPresenter<TViewInterface, TContect>.  There is no implicit reference conversion from IListView to IContextview<IObservableObject>.

Am I defining the ViewPresenter incorrectly?  Or am I not casting it correctly?  Or both?
ASKER CERTIFIED SOLUTION
Avatar of FrancineTaylor
FrancineTaylor

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial