private void UpdatePortInputs() { foreach (var port in inputContainer.OfType <LogicPort>()) { if (!_portInputContainer.OfType <PortInputView>().Any(a => Equals(a.Description, port.Description))) { var portInputView = new PortInputView(port.Description) { style = { positionType = PositionType.Absolute } }; _portInputContainer.Add(portInputView); port.RegisterCallback <GeometryChangedEvent>(evt => UpdatePortInput((LogicPort)evt.target)); } } }
void UpdatePortInputs() { foreach (var port in inputContainer.Children().OfType <LogicPort>()) { if (!_portInputContainer.Children().OfType <PortInputView>().Any(a => Equals(a.Description, port.Slot))) { var portInputView = new PortInputView(port.Slot) { style = { position = Position.Absolute } }; _portInputContainer.Add(portInputView); if (float.IsNaN(port.layout.width)) { port.RegisterCallback <GeometryChangedEvent>(UpdatePortInput); } else { SetPortInputPosition(port, portInputView); } } } }
void SetPortInputPosition(LogicPort port, PortInputView inputView) { inputView.style.top = port.layout.y; inputView.parent.style.height = inputContainer.layout.height; }