This project is read-only.

dynamic WebViewPage<dynamic>.Display

Topics: Writing themes
Feb 23, 2011 at 1:56 PM


I try to understand the dynamic part of Orchard/Razor. I thought 'Display(...)' is a method but found that Display is a (getter) property in the WebViewPage<dynamic>.class.

Other dynamic getters are: Layout, New


In the views Display is used as method:

Display(Model.Body) or Display(Model.Header)

another use I have seen:

Diplay.Header()   or Display.User()

Are that two different members of WebViewPage<dynamic>.class or is it the Clay way 'dynamic Display = new ClayFactory();' ?

Could somebody explain me how it works.


Feb 23, 2011 at 7:46 PM

A displayHelper will get injected as the Display property. The display helper has an invoke method which is what is called when Display(whatever) is getting dynamically resolved and called. Now Display.Whatever() is creating a shape with whatever name.

Feb 23, 2011 at 10:33 PM

O.k. Display(...) returns "private object _display;" which is a displayHelper instance, but how is the Invoke method called?      Display.Invoke(whatever) ?= Display(whatever)  How is this dynamically resolved?

Is Display.Whatever() the same as New.Whatever(), where Whatever is a dynamically created data object?

Mar 6, 2011 at 9:06 AM

I am wondering how the @Display(Model) runs......