public TrackingGate(Gate g, GateInkCanvas gc) { this.g = g; this.gc = gc; gc.Circuit.ReplaceGates += (sender2, e2) => { if (e2.ContainsKey(this.g.AbGate) && e2[this.g.AbGate] != null) { Gate og = this.g; Gate ng = gc.FindGate(e2[this.g.AbGate]); this.g = ng; } }; }