HI! I am trying to somehow get MyBlock class instance from PropertyData.
I have tried:
propertyData.Value as MyBlock;
((MyBlock)propertyData.Value).CreateWritableClone ( );
They all return MyBlockProxy!
ProxyUtil.GetUnproxiedType ( propertyData.Value ); gives the correct type (MyBlock)
ProxyUtil.GetUnproxiedType ( propertyData.Value );
Is there a way to do this?
What is the actual value of your propertyData.Value. The actual value?
This is by design. You define the class MyBlock in code, but you get an instance of MyBlockProxy. Same goes for page types.
MyBlockProxy is a dynamic generated class inherited from MyBlock, you can just use the MyBlockProxy instance as a MyBlock instance, as Stefan said