I have recently been introduced to System.Action returns from dialog forms. When return a single value, i.e. Action<Boolean> or Action<String> they work well.
However, I am now trying to create an Action<Bool, String>, which according to the Action documentation is perfectly legal.
But when I do this I get an error saying incompatible anonymous function signature, and there appears to be no way to recover the values.
The constructor in the dialog is as follows.
private readonly Action<bool, String> _dialogAction;
public GeneralTextDialogFragment(Activity context, Action<bool, String> dialogResult, InputTypes inputType)
_context = context;
_dialogAction = dialogResult;
ValueType = inputType;
And the calling code is
var dialog = new Fragments.GeneralTextDialogFragment(this, dialogResult =>
var result = dialogResult;
// other stuff goes here.
But the dialogResult parameter is red underlined, and the result value, I cannot see the two values.
All of this code works perfectly if I select Action<Boolean> or Action<String>.
Can someone please point out where I am going wrong.
Please note this code is being used in Xamarin (Mono) for Android.