# BindableExtensions.BindDataContext<TWidget, TContext, TValue> examples

Examples for [BindDataContext<TWidget, TContext, TValue>](https://eto.picoe.ca/api/type/eto.forms.bindableextensions/binddatacontext.md) in Eto.Forms.BindableExtensions.

## C#

```cs
using Eto.Forms;

// As an extension method
DualBinding<TValue> result = control.BindDataContext(controlProperty, sourceProperty, mode, defaultControlValue, defaultContextValue);

// As a static method
result = BindableExtensions.BindDataContext(control, controlProperty, sourceProperty, mode, defaultControlValue, defaultContextValue);
```

## Python

```python
import clr
clr.AddReference('Eto')
import Eto.Forms
clr.ImportExtensions(Eto.Forms)

# As an extension method
result = control.BindDataContext(control_property, source_property, mode, default_control_value, default_context_value)

# As a static method
result = Eto.Forms.BindableExtensions.BindDataContext(control, control_property, source_property, mode, default_control_value, default_context_value)
```
