private static void FixUpEventNameImpl(BehaviorEventTriggerNode eventTriggerNode, SceneNode sourceNode) { if (sourceNode == null) { return; } IEnumerable <EventInformation> eventsForType = EventInformation.GetEventsForType((ITypeResolver)eventTriggerNode.ProjectContext, sourceNode.Type, MemberType.LocalEvent); if (!Enumerable.Any <EventInformation>(eventsForType, (Func <EventInformation, bool>)(info => info.EventName.Equals(eventTriggerNode.EventName, StringComparison.Ordinal)))) { bool flag = false; DefaultEventAttribute defaultEventAttribute = TypeUtilities.GetAttribute <DefaultEventAttribute>(sourceNode.TargetType); if (defaultEventAttribute != null && !string.IsNullOrEmpty(defaultEventAttribute.Name) && (TriggerSourceInformation)Enumerable.SingleOrDefault <EventInformation>(eventsForType, (Func <EventInformation, bool>)(eventInfo => eventInfo.EventName == defaultEventAttribute.Name)) != (TriggerSourceInformation)null) { eventTriggerNode.SetValue(BehaviorEventTriggerNode.EventNameProperty, (object)defaultEventAttribute.Name); flag = true; } if (!flag && Enumerable.Any <EventInformation>(eventsForType, (Func <EventInformation, bool>)(info => info.EventName.Equals("Loaded", StringComparison.Ordinal)))) { eventTriggerNode.SetValue(BehaviorEventTriggerNode.EventNameProperty, (object)"Loaded"); } else { eventTriggerNode.ClearValue(BehaviorEventTriggerNode.EventNameProperty); } } ISceneNodeCollection <SceneNode> collectionForProperty = eventTriggerNode.Parent.GetCollectionForProperty(BehaviorHelper.BehaviorTriggersProperty); BehaviorTriggerBaseNode matchingTriggerNode = BehaviorHelper.FindMatchingTriggerNode(eventTriggerNode.DocumentNode, collectionForProperty); if (matchingTriggerNode == null || matchingTriggerNode.Equals((object)eventTriggerNode)) { return; } for (int index = eventTriggerNode.Actions.Count - 1; index >= 0; --index) { BehaviorTriggerActionNode action = (BehaviorTriggerActionNode)eventTriggerNode.Actions[index]; BehaviorHelper.ReparentAction(collectionForProperty, (BehaviorTriggerBaseNode)eventTriggerNode, matchingTriggerNode, action); } collectionForProperty.Remove((SceneNode)eventTriggerNode); }