diff --git a/src/UIKit/UIControl.cs b/src/UIKit/UIControl.cs index e4fc1e47b5..bd9141d2a2 100644 --- a/src/UIKit/UIControl.cs +++ b/src/UIKit/UIControl.cs @@ -47,10 +47,12 @@ namespace UIKit { } public partial class UIControl { - static ConditionalWeakTable>> allTargets = new - ConditionalWeakTable>> (); + static ConditionalWeakTable>> allTargets; public void AddTarget (EventHandler notification, UIControlEvent events) { + if (allTargets == null) + allTargets = new (); + var targets = allTargets.GetValue (this, k => { MarkDirty ();