Configuration dialog refresh

Haven’t found something similar on the forum so I thought I’d ask.

I have a component that hides some parts of the dialog when a choice on the same dialog has been made.

Let’s say I have a radio button of choosing what to configure, y or x.

If y is chosen, i want to hide x from the dialog. The contrary if x is chosen - hide y.

The problem I have is that to hide or unhide, I’ll need to hit ok and open the dialog again.

Is there a way to refresh the dialog without having to open-close?