Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Get block from ContentArea

$
0
0

Hi,

I'm trying to get a hold of a property belonging to the block, of type MyBlock, that I have in a ContentArea.

I have the following code:

private string ShowSavingsAdvice(IList<ContentAreaItem> list)
        {
            var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
            foreach (var item in list)
            {
                var block = contentLoader.Get<BlockData>(item.ContentLink);
            }
            return "";
        }

The variable block is now of the type MyBlockProxy. How do I get it to be of type MyBlock so that I can get a hold of its properties?


Viewing all articles
Browse latest Browse all 9076

Trending Articles