A constraint solver is overkill here, in particular as you cannot solve for A and B uniquely, you might want to add some further rule, like A and B should grow proportionally, when C is modified.
But otherwise, yes, just use a framework that separates State from UI and has bidirectional updates, like SwiftUI.