I’m having a hard time to decouple two classes.
I have my code behind (will call it “class A”) that I use to tweak the interface (defined in xaml).
Next I have a class B that is only logic. But while the logic is executing I have to update the UI.
My problem is that I can’t “return” from the class B back to A to update the UI because B has not finished working. And I can’t give the view itself to modifiy to B because it would couple A and B.
I suppose that I have to use some interfaces logic but I don’t know how.
For example :
Class A { private void OnClickEvent() { var B = new(B); b.work(); } private void UpdateUI() { ... } } Class B { public void work() { while (...) { ... //Here, how to call A.UpdateUI() ? ... } } }
Thanks !