If getting the code to run requires casting to ITypedElement, we should consider reporting this as a bug for the SDK. After all, we aim to replace all functionality through properties and extensions and only have ITypedElement for backward compatibility.