Created
March 29, 2012 17:47
-
-
Save brianium/2240680 to your computer and use it in GitHub Desktop.
sample presenter in web forms mvp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using WebFormsMvp; | |
using BissellMVPTest.BLL.Views.Models; | |
using BissellMVPTest.BLL.Views; | |
using BissellMVPTest.BLL.Views.EventArguments; | |
namespace BissellMVPTest.BLL.Presenters | |
{ | |
public class BlogPostPresenter : Presenter<IBlogPostView> | |
{ | |
public BlogPostPresenter(IBlogPostView view) | |
: base(view) | |
{ | |
View.Saved += new BlogPostHandler(View_Saved); | |
} | |
public override void ReleaseView() | |
{ | |
View.Saved -= new BlogPostHandler(View_Saved); | |
} | |
public void View_Saved(object sender, BlogPostArgs e) | |
{ | |
View.isVisible = true; | |
View.Model.Title = e.PostTitle; | |
View.Model.Content = e.PostContent; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment