This project is read-only.


Behaviour EventCommander don't work in Metro


I was attaching to page's load event and it throws page not loaded exception when trying to create main page in app.vb. i tryed another helper "metroEventToCommand" and it works. So the problem not in my code.


mity wrote May 5, 2013 at 11:09 PM

In CommandEvent class there is a typo in GetEventMethod the line MethodInfo methodInfo = typeof(CommandEvent).GetTypeInfo().DeclaredMethods.FirstOrDefault( mi => mi.Name == "OnEventRaised" && mi.IsPrivate && !mi.IsStatic);

and it was. Which is wrong. As EventCommand dont have OnEventRaised
            MethodInfo methodInfo = typeof(EventCommand).GetTypeInfo().DeclaredMethods.FirstOrDefault(                        mi => mi.Name == "OnEventRaised" && mi.IsPrivate && !mi.IsStatic);

markjulmar wrote May 6, 2013 at 4:55 PM

Make sure to pull the latest trunk - I'm looking at

which has the specific method.

Mark Smith | @marksm | 214-774-4749 |

mity wrote May 6, 2013 at 5:56 PM

Checked with the link you provided. Inside typeof(.....) you have EventCommand but it shoud be CommandEvent . EventCommand don't have OnEventRaised method.

mity wrote May 6, 2013 at 6:02 PM

Sorry inside typeof() you have EventCommander, but only CommandEvent class has OnEventRaised method. EventCommander class has all kind of mapping staff.

markjulmar wrote May 6, 2013 at 6:25 PM

Interesting - let me look into it, thanks for the clarification!

markjulmar wrote May 6, 2013 at 6:29 PM

I always use EventTrigger these days and didn't catch this; I'll fix it ASAP and add a test for it. Thanks for letting me know.


markjulmar wrote May 6, 2013 at 6:43 PM

Fixed in 1.08 on Nuget and CodePlex.