System.Action OnSelectionChanged { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The OnSelectionChanged property is an event handler of type System.Action in the Editor.GraphicsView class. This property is triggered whenever the selection of items within the graphics view changes. It allows you to define custom behavior that should occur in response to selection changes.

Usage

To use the OnSelectionChanged property, assign a method or lambda expression to it that defines the actions to be performed when the selection changes. This is typically used to update UI elements or perform other actions in response to user interactions with the graphics view.

Example

// Example of using the OnSelectionChanged property

// Create an instance of GraphicsView
GraphicsView graphicsView = new GraphicsView();

// Define a method to handle selection changes
void HandleSelectionChanged()
{
    // Custom logic to execute when the selection changes
    Console.WriteLine("Selection has changed.");
}

// Assign the method to the OnSelectionChanged property
graphicsView.OnSelectionChanged = HandleSelectionChanged;

// Alternatively, use a lambda expression
graphicsView.OnSelectionChanged = () => {
    // Custom logic to execute when the selection changes
    Console.WriteLine("Selection has changed.");
};