DynamicObject Constructor

Enables derived types to initialize a new instance of the DynamicObject type.

Namespace:  System.Dynamic
Assembly:  System.Core (in System.Core.dll)

protected DynamicObject()

You cannot directly create an instance of the DynamicObject class. To implement dynamic behavior, you have to inherit from the DynamicObject class and override necessary methods.

In C#, to enable dynamic behavior for instances of the classes derived from the DynamicObject class, you must use the dynamic keyword.

In Visual Basic, dynamic operations are supported by late binding.

The following code example demonstrates how to create an instance of classes that are derived from the DynamicObject class.

public class SampleDynamicObject : DynamicObject {}
//...
dynamic sampleObject = new SampleDynamicObject ();

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: