Пример #1
0
        private IInteractionNode FindOrAddNode(DependencyObject uiElement)
        {
            var node = uiElement.GetValue(NodeProperty) as IInteractionNode;

            if (node == null)
            {
                node = new InteractionNode(uiElement, this);
                uiElement.SetValue(NodeProperty, node);
            }

            return(node);
        }
Пример #2
0
 /// <summary>
 /// Attaches the trigger and prepares it to send actions.
 /// </summary>
 /// <param name="uiElement">The UI element.</param>
 /// <param name="trigger">The trigger.</param>
 public void AttachTrigger(DependencyObject uiElement, IMessageTrigger trigger)
 {
     if (trigger.Message is IRoutedMessageHandler)
     {
         var node = new InteractionNode(uiElement, this);
         node.RegisterHandler(trigger.Message as IRoutedMessageHandler);
         node.AddTrigger(trigger);
     }
     else
     {
         var node = FindOrAddNode(uiElement);
         node.AddTrigger(trigger);
     }
 }
Пример #3
0
 /// <summary>
 /// Attaches the trigger and prepares it to send actions.
 /// </summary>
 /// <param name="uiElement">The UI element.</param>
 /// <param name="trigger">The trigger.</param>
 public void AttachTrigger(DependencyObject uiElement, IMessageTrigger trigger)
 {
     if(trigger.Message is IRoutedMessageHandler)
     {
         var node = new InteractionNode(uiElement, this);
         node.RegisterHandler(trigger.Message as IRoutedMessageHandler);
         node.AddTrigger(trigger);
     }
     else
     {
         var node = FindOrAddNode(uiElement);
         node.AddTrigger(trigger);
     }
 }
Пример #4
0
        private IInteractionNode FindOrAddNode(DependencyObject uiElement)
        {
            var node = uiElement.GetValue(NodeProperty) as IInteractionNode;

            if(node == null)
            {
                node = new InteractionNode(uiElement, this);
                uiElement.SetValue(NodeProperty, node);
            }

            return node;
        }