<igDP:Field Name="Name" Label="{igDP:FieldBinding MyProperty}" />
This topic describes how to bind the Field, FieldSettings, FieldLayout and FieldLayoutSettings to MVVM properties using the FieldBinding markup extension in the xamDataPresenter™ controls.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
Use the Field/ FieldLayout DataContext
property to facilitate the MVVM binding.
By default, if the Field
/FieldLayout
DataContext
property is not explicitly set, it takes the xamDataPresenter control’s DataContext
.
The following table maps the desired configuration to the property settings that manage it.
Use the FieldBinding markup extension to facilitate the binding of Field, FieldSettings, FieldLayout and FieldLayoutSettings to MVVM properties.
The binding to MVVM properties can be implemented in any one of the following ways:
In XAML:
<igDP:Field Name="Name" Label="{igDP:FieldBinding MyProperty}" />
In XAML:
<igDP:Field Name="Name" Label="{Binding Path=Owner.DataPresenter.DataContext. MyProperty, RelativeSource={RelativeSource Self}}" />
In XAML:
<igDP:Field Name="Name" Label="{Binding Path=DataContext.MyProperty, RelativeSource={RelativeSource Self}}" />
The following topics provide additional information related to this topic.