PropertyGrid > PropertyGrid Features > Using SelectedObject Property |
The C1PropertyGrid.SelectedObject property determines the object for which the C1PropertyGrid control displays properties to edit. You can set the SelectedObject property to any object. For example, you can connect the C1PropertyGrid control to a control as in the PropertyGrid for WPF Quick Start or you can bind the control to a class as in the Binding C1PropertyGrid to a Class topic.
In XAML, you would use a binding statement to connect the C1PropertyGrid control to an object. For example, the following C1PropertyGrid control is linked to a button object:
XAML |
Copy Code
|
---|---|
<c1:C1PropertyGrid Margin="244,152,186,168" SelectedObject="{Binding ElementName=button, Mode=OneWay}"/> |
You can also set the SelectedObject property in Design view in Blend by selecting the square Advanced Properties icon next to the SelectedObject item in the Properties window and selecting Data Binding. The Create Data Binding dialog box will appear allowing you to choose an object to bind to.