Your choice of having two separate controls is actually my first choice.
This has the advantage of allowing you to carefully check both of your controls. You can easily use triggers to switch which control is visible based on any criteria in your DataContext. It is clean, simple and quite elegant.
There are other options if you want to avoid this.
For example, you can use the ContentPresenter for this “box” and bind it to a property in the DataContext, which is simply defined as an “object”. Then at runtime you could set it to a separate type when it is authenticated against unidentified. By specifying a DataTemplate for each type, WPF will automatically attach the appropriate control for you. (This is basically an MVPM style approach based on ViewModel-one).
source share