title: How can I pass a variable number of arguments in a Func type declaration?
body: <p>I have to implement a control in VB.Net where one of the properties is a function: basically, the user will set a certain function as an argument during the creation of the control, and the control will do something accordingly. A short example:</p>
  
  <pre><code>' Signature of the property
  Public Property VarMethod As Func(Of DataRow, String)    
  
  ' Assigning the function to the control
  control.VarMethod = AddressOf ToBeCalled
  
  ' Function that should be called
  Private Function ToBeCalled(row as DataRow) As String
  </code></pre>
  
  <p>Something like that. I'd like to alter the property so that it can accept functions with a variable number of arguments, in case the row isn't enough for the function: basically, it should work even with functions like, for example, ToBeCalled(row as Datarow, index as Integer). I thought I could do something with ParamArray, but Func doesn't seem to accept it in the definition: adding a Object() to the definition, on the other hand, forces me to insert the secondary parameters every time. Do you know if there's a way to define the type Func so that it works the way I want it to? Thanks</p>