Caliburn.Micro.Action.Invoke C# (CSharp) Метод

Invoke() публичный статический Метод

Uses the action pipeline to invoke the method.
public static Invoke ( object target, string methodName, global::Xamarin.Forms.BindableObject view = null, global::Xamarin.Forms.VisualElement source = null, object eventArgs = null, object parameters = null ) : void
target object The object instance to invoke the method on.
methodName string The name of the method to invoke.
view global::Xamarin.Forms.BindableObject The view.
source global::Xamarin.Forms.VisualElement The source of the invocation.
eventArgs object The event args.
parameters object The method parameters.
Результат void
        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 = message,
                View = view,
                Source = source,
                EventArgs = eventArgs
            };

            if (parameters != null) {
                parameters.Apply(x => context.Message.Parameters.Add(x as Parameter ?? new Parameter { Value = x }));
            }

            ActionMessage.InvokeAction(context);

            // This is a bit of hack but keeps message being garbage collected
            Log.Info("Invoking action {0} on {1}.", message.MethodName, target);
        }
#endif