SkillAgentSearch skills...

DynamicObjectTwoWayDataBinding

AN example showing how to perform two-way databinding using a dynamic object in Windows Forms.

Install / Use

/learn @r-aghaei/DynamicObjectTwoWayDataBinding
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

DynamicObject Two-Way Data Binding

To create a Dynamic Object which you can use for two-way data-binding to Windows Forms control, you should derfive from DynamicObject and also implement ICustomTypeDescriptor and INotifyPropertyChanged interface.

ICustomTypeDescriptor is responsible to return metadata about the object including a list of properties. Since DynamicObject doesn't have real properties, you should return a list of custom PropertyDescriptor objects which allow the consumer to get/set value of the property.

INotifyPropertyChanged is responsible for raising PropertyChanged event. It's a key point in two-way data-binding.

In the example, I've craeted an implementation of the DynamicObject which you can simply add properties to it and use for two-wat data-binding in Windows Forms.

dynamic object two way databinding

Related Skills

View on GitHub
GitHub Stars10
CategoryDevelopment
Updated3y ago
Forks4

Languages

C#

Security Score

60/100

Audited on Nov 15, 2022

No findings