Go to the documentation of this file.00001 using System;
00002 using System.Web.Mvc;
00003 using N2.Web.UI;
00004 using N2.Web.Mvc.Html;
00005
00006 namespace N2.Web.Mvc
00007 {
00016 public class ContentViewUserControl<TModel, TItem> : ViewUserControl<TModel>, IItemContainer
00017 where TModel : class
00018 where TItem : ContentItem
00019 {
00020 #region IItemContainer Members
00021
00022 ContentItem IItemContainer.CurrentItem
00023 {
00024 get { return Content; }
00025 }
00026
00027 #endregion
00028
00029 public TItem content;
00030 public TItem Content
00031 {
00032 get { return content ?? (content = ViewContext.CurrentItem<TItem>()); }
00033 set { content = value; }
00034 }
00035
00036 HtmlHelper<TItem> contentHtml;
00037 public HtmlHelper<TItem> ContentHtml
00038 {
00039 get { return contentHtml ?? (contentHtml = ViewContext.CreateContentItemHelper<TItem>()); }
00040 set { contentHtml = value; }
00041 }
00042 }
00043 }