public static void AttachToMap(Map map, InfoBox infoBox) { var behavior = _InfoBoxEventBehavior; //var behavior = map.EventBehavior.List[BehaviorName] as InfoBoxEventBehavior; if (behavior != null) { if (!ReferenceEquals(behavior.infoBox, infoBox)) { behavior.infoBox.Hide(true); } behavior.infoBox = infoBox; } else { _InfoBoxEventBehavior = new InfoBoxEventBehavior(map, infoBox); //behavior = new InfoBoxEventBehavior(map, infoBox); //map.EventBehavior.List.Add(behavior); } }
//: base(BehaviorName) public InfoBoxEventBehavior(Map map, InfoBox infoBox) { _Map = map; this.infoBox = infoBox; }