Live Chat Icon For mobile
Live Chat Icon

How to pass a parameter to a constructor using ObjectDataProvider ?

Platform: WPF| Category: DataBinding

ObjectDataProvider provides the ability to pass the parameters to the constructors using the ‘ConstructorParameters’ property.

The following code snippet demonstrates how to pass parameters to a constructor.

[XAML]

<ObjectDataProvider ObjectType='{x:Type local:odpsource}' x:Key='obj1?>
<ObjectDataProvider.ConstructorParameters>
<system:Double>2000</system:Double>
</ObjectDataProvider.ConstructorParameters>
</ObjectDataProvider>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.