Views: 3.1K
Replies: 0
Archived
|
MVP pattern on .net 4.5 problem with the presenter classHi,
I'm using the MVP for winform project in .net 4.5 C# 5.0. The problem is in my presenter class witch create new instance at each time on .net 4.5 protected static IModel Model; with a static constructor (static Presenter()) and a public constructor public Presenter(T view) Event if my member Model is static it create a new instance. Any ideal what is the problem in C# 5.0 Martin public class Presenter<T> where T : IView { /// <summary> /// Gets and sets the model statically. /// </summary> protected static IModel Model; /// <summary> /// Gets the view. /// </summary> /// <value> /// The view. /// </value> protected T View { get; private set; } /// <summary> /// Initializes a new instance of the <see cref="Presenter{T}" /> class. /// </summary> static Presenter() { Model = new Model(); } /// <summary> /// Initializes a new instance of the <see cref="Presenter{T}" /> class. /// </summary> /// <param name="view">The view.</param> public Presenter(T view) { View = view; } } Martin La Salle, Nov 09, 2012
|