{"record":{"id":"9ee86fa635c22635","repo":"PrismLibrary/Prism","slug":"unable-to-find-eventargsparameterpath","errorCode":null,"errorMessage":"Unable to find {EventArgsParameterPath}","messagePattern":"Unable to find (.+?)","errorType":"exception","errorClass":"MissingMemberException","httpStatus":null,"severity":"error","filePath":"src/Maui/Prism.Maui/Behaviors/EventToCommandBehavior.cs","lineNumber":226,"sourceCode":"    protected virtual void OnEventRaised(object sender, EventArgs eventArgs)\n    {\n        if (Command == null)\n        {\n            return;\n        }\n\n        var parameter = CommandParameter;\n\n        if (parameter == null && !string.IsNullOrEmpty(EventArgsParameterPath))\n        {\n            //Walk the ParameterPath for nested properties.\n            var propertyPathParts = EventArgsParameterPath.Split('.');\n            object propertyValue = eventArgs;\n            foreach (var propertyPathPart in propertyPathParts)\n            {\n                var propInfo = propertyValue.GetType().GetRuntimeProperty(propertyPathPart);\n                if (propInfo == null)\n                    throw new MissingMemberException($\"Unable to find {EventArgsParameterPath}\");\n\n                propertyValue = propInfo.GetValue(propertyValue);\n                if (propertyValue == null)\n                {\n                    break;\n                }\n            }\n            parameter = propertyValue;\n        }\n\n        if (parameter == null && eventArgs != null && EventArgsConverter != null)\n        {\n            parameter = EventArgsConverter.Convert(eventArgs, typeof(object), EventArgsConverterParameter,\n                CultureInfo.CurrentUICulture);\n        }\n\n        if (Command.CanExecute(parameter))\n        {","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Maui/Prism.Maui/Behaviors/EventToCommandBehavior.cs#L208-L244","documentation":"EventToCommandBehavior can extract a command parameter from the event args by walking the property path in EventArgsParameterPath (dot-separated). If reflection cannot find a property for one path segment on the event args object, it throws MissingMemberException 'Unable to find {EventArgsParameterPath}'.","triggerScenarios":"Setting EventArgsParameterPath to a property path that doesn't exist on the actual event args runtime type — e.g. \"SelectedItem\" when the args type has no such property, or a multi-segment path like \"Item.Name\" where an intermediate segment is wrong.","commonSituations":"Path written for one event args type but the event changed (e.g. TappedEventArgs vs ItemTappedEventArgs); platform-specific args types lacking the property; typos or casing differences in the path.","solutions":["Verify the property exists on the concrete EventArgs type for the wired event and fix the path (exact casing).","Use EventArgsConverter instead of EventArgsParameterPath when args types vary or the path is unreliable.","Check each dot-separated segment matches a real property on the intermediate object.","If the event args can differ by platform, use a converter with type checks."],"exampleFix":"<!-- before -->\n<prism:EventToCommandBehavior EventName=\"ItemTapped\" EventArgsParameterPath=\"Selected.Item\" />\n<!-- after -->\n<prism:EventToCommandBehavior EventName=\"ItemTapped\" EventArgsParameterPath=\"Item\" />","handlingStrategy":"validation","validationCode":"var args = someEventArgs;\nforeach (var part in EventArgsParameterPath.Split('.'))\n    if (args?.GetType().GetRuntimeProperty(part) is null)\n        throw new ArgumentException($\"Property path '{EventArgsParameterPath}' invalid for {args?.GetType().Name}\");","typeGuard":"bool PathExists(object o, string path) => path.Split('.').All(p => (o = o?.GetType().GetRuntimeProperty(p)?.GetValue(o)) != null);","tryCatchPattern":"try { /* raise event through behavior */ }\ncatch (MissingMemberException ex) when (ex.Message.Contains(\"EventArgsParameterPath\")) { /* fix path or use converter */ }","preventionTips":["Confirm each dot-separated segment against the concrete EventArgs type","Prefer EventArgsConverter for dynamic or platform-specific event args","Add unit tests that raise the real event and exercise the parameter path"],"tags":["maui","reflection","events","property-path"],"backgroundTag":"resource-not-found","analyzedSha":"358118cd640d9a22ff8cf21c8ad197fa038b7990","analyzedAt":"2026-09-15T15:00:31.079Z","contentChangedAt":"2026-09-15T15:00:31.079Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}