Category / Section
How to hide center ConnectionPort?
1 min read
By default, all nodes contain a port in its center and there is no inbuilt mechanism to hide them. However, you can remove or delete it in its loaded event.
The following code example depicts how to delete the center ConnectionPort in the node.
C#
// Registering Node Loaded event node.Loaded += node_Loaded; // To delete all the ConnectionPorts in the Node void node_Loaded(object sender, RoutedEventArgs e) { (sender as Node).Ports.Clear(); }
C#
// Registering Node Loaded event node.Loaded += node_Loaded; // To delete the particular ConnectionPort in the Node void node_Loaded(object sender, RoutedEventArgs e) { // Specify the position of the port (index) to be removed. (sender as Node).Ports.RemoveAt(index); }
node – refers to the instance of the Node.