The StyleData
property provides access to data specific to the
The StyleData
property provides access to data specific to the
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}");
}
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}"); }