*No*, this is definitely not ok.  The whole point of how I wrote this was to make it unaware of what UI it is interfacing with.  This completely violates the design principle and precludes it being used in other contexts like wizards etc.