Click or drag to resize

VisualAddCustomProperty Method (String, Object, String)

Add a custom property to the visual. If the custom property already exists, then this call will update its value and description.

Namespace:  Demo3D.Visuals
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 15.0.2.11458
Syntax
C#
public CustomProperty AddCustomProperty(
	string name,
	Object val,
	string description
)

Parameters

name
Type: SystemString
Name of custom property to create.
val
Type: SystemObject
Initial value of custom property.
description
Type: SystemString
Description of the property, shown in the property grid

Return Value

Type: CustomProperty
A newly-created or updated CustomProperty object
Examples
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