If, lets say I have a FormA with a ListView and an Update() function. Then I also have one Math-Class with a function A() wich does some magic… Can a delegate be used to call Update() from A()? Or Is there a better way? I’ve realized it’s risky to update a gui form from another class…. Thanks in advance!
Share
Yes. Its not that risky as long as the Math class has no knowledge of what its actually calling. You just give it a rough idea by pointing it to the desired function from your Form:
In your form you would do this:
Your MathClass calls Update, but it has no knowledge of the object that told it to call Update or where Update is.. making it safer than tightly coupling your objects together.