A delegate is a safe function pointer, you should be assigning a method to a declared variable of that name not trying to assign the type itself which you are doing.
class MyGameClass
{
SetGameAreaDelegate handler;
MyGameClass()
{
// Instantiate the handler (since my callback is a non-static method)
// You'll need to preform this assignment in the constructor, 'this'
// is not valid during initialization
handler = new SetGameAreaDelegate(myGameAreaWithCallback);
handler = MyGameAreaWithCallback; // short for above
}
void MyGameAreaWithCallback(Game1.gameAreas newArea)
{
//...
}
}
Update: Details about delegates
A delegate is a managed wrapper for function pointers. It has it's own type signature and is presumably a save alternative to just raw function pointers. A delegate can hold a reference to an instance object like a C++ style member function pointer but you never have to worry about this because the run-time figures out this kind of information for you.
It might be good to know that a delegate to a non-static method will track a reference to that object. This can result in memory not being garbage collected because delegates while they might look harmless, maintain or track object references.
The problem with your code is that the type signature...
void SetGameAreaWithCallback(Game1.gameAreas newArea, SetGameAreaDelegate callback)
...doesn't match your delegate type...
delegate void SetGameAreaDelegate(Game1.gameAreas newArea);
...for this to work...
SetGameAreaDelegate handler = SetGameAreaWithCallback;
...your delegate should have been...
delegate void SetGameAreaDelegate(Game1.gameAreas newArea, SetGameAreaDelegate callback);
...you forgot a parameter if this is what you really meant, that is why the method resolution fails.