Using methods as a default parameter
<p>I'm looking to create a Button class in my custom XNA GUI that accepts methods as an argument, similar to how, in Python's <code>tkinter</code> you can just set the function to be called with  <code>Button.config(command = a_method)</code> .</p>

<p>I've read about using delegates as parameters <a href="http://www.google.ca/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=2&amp;cad=rja&amp;sqi=2&amp;ved=0CCkQFjAB&amp;url=http://stackoverflow.com/questions/380198/how-to-pass-a-function-as-a-parameter-in-c&amp;ei=e3Y2UNPJM4bfyAHW-oGICw&amp;usg=AFQjCNEJI85iXmefOC4TRTn0RlhvhDwpkw&amp;sig2=XKmcfdlKsk3HAH-2J_8cCQ" rel="nofollow">here</a>, <a href="http://www.google.ca/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;sqi=2&amp;ved=0CCEQFjAA&amp;url=http://stackoverflow.com/questions/2082615/pass-method-as-parameter-using-c-sharp&amp;ei=e3Y2UNPJM4bfyAHW-oGICw&amp;usg=AFQjCNHnA3DOB5pCKUozFhVKJV6uscmDeg&amp;sig2=VBITNlkKGth4vCZ5qA8q7Q" rel="nofollow">here</a> and <a href="http://stackoverflow.com/questions/2315468/is-there-an-easier-way-to-give-a-function-an-alias-name-in-c-sharp/2315555#2315555">here</a>, but I don't seem to be any closer to getting it working. I don't fully understand how delegates work, but I've tried several different things unsuccessfully, like using <code>Func&lt;int&gt;? command  = null</code> in order to test later to see if <code>command</code> is <code>null</code> then I'd call the preset default, but then I get a <code>Func cannot be nullable type</code> or something similar.</p>

<p>Ideally the code'd be something like:</p>

<pre><code>class Button
{
//Don't know what to put instead of Func
Func command;

// accepts an argument that will be stored for an OnClick event
public Button(Action command = DefaultMethod)
  {
    if (command != DefaultMethod)
    {
       this.command = command;
    }
  }
}
</code></pre>

<p>But it seems like everything I've tried is not working out.</p>
