FrancineTaylor
asked on
trying to store a pointer to my presenter in view class
Here's my presenter class:
public class ListPresenter<TViewInterfa ce, TContext> : Presenter<TViewInterface, TContext>
where TViewInterface : IContextView<TContext>, IListView
where TContext : IObservableObject
{
protected override void OnInitializePresentationCo mplete(dyn amic data)
{
View.ViewPresenter = (ListPresenter<TViewInterf ace, 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<TViewInterfa ce, TContect>. There is no implicit reference conversion from IListView to IContextview<IObservableOb ject>.
Am I defining the ViewPresenter incorrectly? Or am I not casting it correctly? Or both?
public class ListPresenter<TViewInterfa
where TViewInterface : IContextView<TContext>, IListView
where TContext : IObservableObject
{
protected override void OnInitializePresentationCo
{
View.ViewPresenter = (ListPresenter<TViewInterf
}
}
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<TViewInterfa
Am I defining the ViewPresenter incorrectly? Or am I not casting it correctly? Or both?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.