Class BindingProxy
A proxy to allow binding of a DependencyObject that is not part of a visual tree (e.g. a DataGridColumn).
Namespace: Sartorius.SAF.Presentation.Infrastructure
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class BindingProxy : Freezable
Examples
The following example shows how to bind the visibility of a DataGridColumn to a property of the current data context.
<SAF:DataGrid>
<SAF:DataGrid.Resources>
<SAF:BindingProxy x:Key="DataContextProxy" DataContext="{Binding}" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</SAF:DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Property}"
Visibility="{Binding DataContext.IsColumnVisible, Source={StaticResource DataContextProxy}, Converter={StaticResource BooleanToVisibilityConverter}}" />
</DataGrid.Columns>
</SAF:DataGrid>
Fields
View SourceDataContextProperty
Identifies the DependencyProperty for DataContext.
Declaration
public static readonly DependencyProperty DataContextProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceDataContext
Gets or sets the data context.
Declaration
public object DataContext { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Methods
View SourceCreateInstanceCore()
When implemented in a derived class, creates a new instance of the Freezable derived class.
Declaration
protected override Freezable CreateInstanceCore()
Returns
| Type | Description |
|---|---|
| Freezable | The new instance. |