Prevent UserControl Constructor from executing when Active Tab is changed

Someone asked on Stack Overflow:

I have Tab Control, with two tabs, and each tab contains a UserControl, the UserControls have Visual States defined along with Transitions.

The issue, that I’d like to get around, is that every time I change active tabs, the Visual State Transition storyboard runs, even when the control should already be in a state, and not need to be changed.

I’ve tracked this to the fact that changing tabs, causes the Constructor for all child UserControls in the newly visible tab to run. Is there a way to avoid this?

I posted the following answer, which was chosen as the accepted answer:

Turns out that because I binding the Content of the Tab it was unloading and reloading. Changing over to StaticResources and using DataContext fixed the issue in my case.


Originally posted on Stack Overflow — 0 upvotes (accepted answer). Licensed under CC BY-SA.

signed letter b

Dad. Geek. Gamer. Software developer. Cloud user. Old Car enthusiast.  Blogger.


Top Posts


profile for Nate on Stack Exchange, a network of free, community-driven Q&A sites
a proud member of the blue team of 512KB club
Thoughts, opinions, and ideas shared here are my own. © 2026 Nate Bross.