I am currently writing a little game with standard UI controls.
It is working great so far but what I don’t like is that I am managing the controls in the codebehind file. (C#)
As I am trying to decouple all elements, I would like to have a separate engine / controller which handles all the data management and the logic for my user interface.
Is there a possibility to register the controls with the engine so that I don’t need to pass them down with every method I call?
Currently I am forced to pass the controls every time I call the function..
Thanks in advance!
Will be good if you can elaborate more on your current implementation. From what I can understand, instead of trying to figure out how to ‘register the controls with the engine’, why not try to see if it’s a design issue.
Perhaps there’s a better way to structure your app/classes/components so that you can decouple logically for better reusability and maintainability?