The title says it all. I am writing a function that takes in another function as an argument like so:
void function(Action func) { }
which works just fine. I want to be able to call the function without any parameters, though, so I can use that function as an argument to another function and so on. I know default values for parameters can be set by:
void function(int x = 0) { }
but if I try:
void function(Action func = anotherFunction) { }
I get an error that states "Default parameter value for 'func' must be compile-time constant". Is it possible to set a default function? if so, how? This is being used in a cross-platform Xamarin Forms mobile application, so cross-platform functionality is necessary. All functions return void and only take in the one argument. The argument function determines which function gets called after the user clicks "Submit"