public void AddTarget(EventHandler notification, UIControlEvent events) { #if XAMCORE_2_0 var targets = allTargets.GetValue(this, k => { MarkDirty(); return(new Dictionary <EventHandler, Dictionary <UIControlEvent, UIControlEventProxy> > ()); }); #else if (targets == null) { targets = new Dictionary <EventHandler, Dictionary <UIControlEvent, UIControlEventProxy> > (); MarkDirty(); } #endif Dictionary <UIControlEvent, UIControlEventProxy> t; if (!targets.TryGetValue(notification, out t)) { t = new Dictionary <UIControlEvent, UIControlEventProxy> (); targets [notification] = t; } UIControlEventProxy ep; if (!t.TryGetValue(events, out ep)) { ep = new UIControlEventProxy(this, notification); t [events] = ep; AddTarget(ep, Selector.GetHandle(UIControlEventProxy.BridgeSelector), events); } else { ep.Counter++; } }
public void AddTarget(EventHandler notification, UIControlEvent events) { #if XAMCORE_2_0 var targets = allTargets.GetValue (this, k => { MarkDirty (); return new Dictionary<EventHandler, Dictionary<UIControlEvent, UIControlEventProxy>> (); }); #else if (targets == null) { targets = new Dictionary<EventHandler, Dictionary<UIControlEvent, UIControlEventProxy>> (); MarkDirty (); } #endif Dictionary<UIControlEvent, UIControlEventProxy> t; if (!targets.TryGetValue (notification, out t)) { t = new Dictionary<UIControlEvent, UIControlEventProxy> (); targets [notification] = t; } UIControlEventProxy ep; if (!t.TryGetValue (events, out ep)) { ep = new UIControlEventProxy (this, notification); t [events] = ep; AddTarget (ep, Selector.GetHandle (UIControlEventProxy.BridgeSelector), events); } else { ep.Counter++; } }