Hi Guys,
I came across this and I was wondering if there is a better way for adding multiple strings to a list without using a for each loop.
So before sharing the XAML file for the solution let just explain once again how the activity invoke method works.
What you need to do for it to work is three things:
- Write the variable name that you want to perform the method on in the “TargetObject” property.
- Write the method name in the “MethodName” property.
- In properties panel in the parameters add collection that should contain the arguments that the method should work with (you must make sure how much and what type of arguments your method accepts, if two arguments then each one of them must be on a specific line)
For this specific case you need to use AddRange with a single argument of the type IEnumerable<String>
where its value should look like this {“Str1”,“Str2”,…}
Finally here is a XAML file illustrating all I said: InvokeMethodAddStrings.xaml (8.0 KB)
Regards,
Reda