Skip to content

Commit

Permalink
Hold a reference to Message in Action.Invoke. Resolves #133
Browse files Browse the repository at this point in the history
  • Loading branch information
nigel-sampson committed Mar 10, 2015
1 parent 1146817 commit a4b7a0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Caliburn.Micro.Platform/Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,17 @@ public static bool HasTargetSet(DependencyObject element) {
///<param name="eventArgs"> The event args. </param>
///<param name="parameters"> The method parameters. </param>
public static void Invoke(object target, string methodName, DependencyObject view = null, FrameworkElement source = null, object eventArgs = null, object[] parameters = null) {

var message = new ActionMessage {MethodName = methodName};

var context = new ActionExecutionContext {
Target = target,
#if WinRT
Method = target.GetType().GetRuntimeMethods().Single(m => m.Name == methodName),
#else
Method = target.GetType().GetMethod(methodName),
#endif
Message = new ActionMessage {MethodName = methodName},
Message = message,
View = view,
Source = source,
EventArgs = eventArgs
Expand Down

0 comments on commit a4b7a0c

Please sign in to comment.