I'm trying to access to built-in properties of BlockData such as CreatedBy, Created however Its seem no easy way to achieve it, casting to BlockData, IContent, IContentData did not help, I can see them when debugging but they are belong to Proxy type at runtime. Does any one know how to achieve it?
Any help would be very appriciated!
Doing reflection can solve the problem but I dont want to use reflection.
You'll have to cast to the interface which defines the properties, ie IChangeTrackable, IVersionable etc. Note that you may want to begin by checking if the block is IContent in case the block is a "local" block which won't implement those interfaces.
Given that the block is a shared block you can have a look at what interfaces the ContentMixin class and its base class BasicContent implements. All of those interfaces will be implemented by your shared block as well.
Thank you Joel!
It sounds make sense, I'll give it a try.
ps: I'm enjoy reading your blog.