I am working on a WPF project where an algorithm executes and depending on the result obtained, polygons on a canvas are adjusted. It is convenient to initialize all objects and call algorithms directly from the main window (where the UI in handled) as this will then make it easy to update the actual locations of the polygons.
What would be a better way to do it?
My first approach was to create a new class to handle flow and communicate with the UI using events. Would this be a better approach?