I am trying to do as the title suggests, however I am getting confused.
I get the idea of how the delegate is supposed to work, but Visual Studio is telling me i’m wrong. Microsoft documentation that says how to do this contains a convoluted example that uses a bookstore program that contains templates and a bunch of logic code that makes it hard to follow.
How do you do this? Thanks.
I assume, in your example, that you want the
SetGameAreaWithCallbackmethod to actually call thechangeGameAreamethod on an instance ofGame1.To do this you need to create your delegate instance so that it refers to that method:
If you’re using C#2 or above then the syntax is even simpler: