I converted this C# Object Display Template linked by Denis to Visual Basic. Like the default object view template, it has a TemplateDepth check, but it's set to 5 instead of 1, and unlike the default, it displays views when metadata.IsComplexType is true.
@Code
Dim shouldKnow As Func(Of ModelMetadata, Boolean) =
Function(metadata) metadata.ShowForDisplay And Not ViewData.TemplateInfo.Visited(metadata)
End Code
@If ViewData.TemplateInfo.TemplateDepth > 5 Then
If Model = Nothing Then
@ViewData.ModelMetadata.NullDisplayText
Else
@ViewData.ModelMetadata.SimpleDisplayText
End If
Else
For Each prop In ViewData.ModelMetadata.Properties.Where(shouldKnow)
If prop.HideSurroundingHtml Then
@Html.Display(prop.PropertyName)
Else
@<div class="control-group">
@Code
Dim label = Html.Label(prop.PropertyName)
If String.IsNullOrEmpty(label.ToHtmlString()) = False Then
@<div class="control-label">
@label
</div>
End If
End Code
<div class="controls">
@Html.Display(prop.PropertyName)
</div>
</div>
End If
Next
End If