EventTrigger question RRS feed

  • Question

  • Hi,

    I've started implementing my own InvokeDelegateCommand trigger action which will invoke Prism delegate command and have a problem with EventTrigger.

    Event trigger doesn't invoke actions if control is dynamically created.

    Here is code sample of test (Invoke method of InvokeDelegateCommandAction is not called).

            public void Test()
                var button = new ClickableObjectMock();
                var eventTrigger = new EventTrigger("Click");
                var triggers = Interaction.GetTriggers(button);
                eventTrigger.Actions.Add(new InvokeDelegateCommandAction());
    If i will do the same with control, which is present in visual tree everything works correct. For example I will recieve button instance in code behind of user control.

    Alexey Zakharov
    Thursday, August 6, 2009 9:39 AM


  • To fix the problem TestClass should be inherited from PresentationTest. That will allow to place button in special test panel container:

    Thursday, August 6, 2009 10:00 AM