Skip to content

Instantly share code, notes, and snippets.

@brianium
Created March 29, 2012 17:47
Show Gist options
  • Save brianium/2240680 to your computer and use it in GitHub Desktop.
Save brianium/2240680 to your computer and use it in GitHub Desktop.
sample presenter in web forms mvp
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