@*   Xafari Framework version : 17.2.3011.1336   *@

@using DevExpress.ExpressApp.Editors
@using DevExpress.ExpressApp.Model
@using DevExpress.ExpressApp.Utils
@using DevExpress.ExpressApp.Web.Editors.ASPx
@using DevExpress.Web
@using Xafari.Mvc
@using Xafari.Mvc.Editors

@helper CreateControl(MvcControlExtension<MvcPropertyEditor> propertyEditorControl, IModelColumn column, object obj)
{
	if (column != null)
	{
		var propertyEditor = propertyEditorControl.Control;
		if ((obj != null) && (propertyEditor != null))
		{
			//propertyEditor.ViewEditMode = propertyEditor.SupportInlineEdit ? this.ViewEditMode : ViewEditMode.View;
			propertyEditor.ViewEditMode = ViewEditMode.View;
			propertyEditor.CreateControl();
			var custom = propertyEditor as ICustomBehaviorInListView;
			if (custom != null)
			{
				custom.CustomizeForListView();
			}
			propertyEditor.CurrentObject = obj;
			var control = (IMvcControl)propertyEditor.Control;
			//if (this.ViewEditMode == ViewEditMode.View)
			//{
			//    this.propertyEditor.SetControlAlignment(WebAlignmentProvider.GetAlignment(column.MemberInfo.MemberType));
			//}
			//if (this.ViewEditMode == ViewEditMode.Edit)
			//{
			//    this.editingObject = obj;
			//}
			//control.Render(Html);
			propertyEditorControl.HtmlHelper.Xafari().MvcControl(control).Render(__razor_helper_writer);
		}
		if (propertyEditor == null)
		{
			var obj2 = (obj == null) ? null : column.ModelMember.MemberInfo.GetValue(obj);
			@Html.Encode((obj2 == null) ? CaptionHelper.NullValueText : obj2.ToString()).Replace("\r\n", "<br />").Replace("\n", "<br />")
		}
	}
}
