Click or drag to resize

VisualAddBindingInterface Method

Add a custom property to the visual which. This property is set to be a binding interface using the declared access rights.

Namespace: Demo3D.Visuals
Assembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntax
C#
public CustomProperty AddBindingInterface(
	IBindingInterfaceOwner owner,
	string name,
	Object val,
	string description,
	AccessRights accessRights,
	string prefix = null,
	string separator = null,
	bool renameFirstInstance = false
)

Parameters

owner  IBindingInterfaceOwner
Name of custom property to create.
name  String
Name of custom property to create.
val  Object
Initial value of custom property.
description  String
Description of the property, shown in the property grid
accessRights  AccessRights
Set the access rights of the binding interface
prefix  String  (Optional)
If the visual already has a custom property with the same name this will be used to prefix the name of the property
separator  String  (Optional)
If the visual already has a custom property with the same name this will used to separate the prefix and the name of the separator
renameFirstInstance  Boolean  (Optional)
When true, always rename the custom property.

Return Value

CustomProperty
A newly-created or updated CustomProperty object
Remarks
If both prefix and separator are null, the property will not be renamed.
Example
C#
// Create a new custom property of type String with value "X":
sender.AddCustomProperty("Label", "X", "My Label property");

// You can also set a category for your custom properties:
var cp = sender.AddCustomProperty("Label", "X", "My Label property");
cp.Category = "My Properties";

// You can also take short-cut and avoid defining the cp variable:
sender.AddCustomProperty(
    "Label",
    "X",
    "My Label property"
    ).Category = "My Properties";
See Also