System.Object StyleData { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The StyleData property provides access to data specific to the associated with a connection in the node editor. This property allows you to store and retrieve custom style-related information for each connection, enabling you to customize the appearance and behavior of connections based on their style.

Usage

To use the StyleData property, you can get or set the data associated with a specific connection style. This is useful when you need to apply custom styling or behavior to connections in the node editor based on their style.

Example usage:

var connection = new Editor.NodeEditor.Connection();
// Set custom style data
connection.StyleData = new CustomStyleData { Thickness = 2.0f, DashPattern = new float[] { 5, 2 } };

// Retrieve the style data
var styleData = connection.StyleData as CustomStyleData;
if (styleData != null)
{
    // Use the style data
    Console.WriteLine($"Connection thickness: {styleData.Thickness}");
}

Example

var connection = new Editor.NodeEditor.Connection();
// Set custom style data
connection.StyleData = new CustomStyleData { Thickness = 2.0f, DashPattern = new float[] { 5, 2 } };

// Retrieve the style data
var styleData = connection.StyleData as CustomStyleData;
if (styleData != null)
{
    // Use the style data
    Console.WriteLine($"Connection thickness: {styleData.Thickness}");
}