Are you just trying to define startup logic for a UserControl
?
Then it depends what you're trying to initialize:
- Are you trying to initialize all sorts of UI-related data?
The best solution would be either in the constructor, or in the Loaded
event in code behind
- Are you trying to initialize the underlying data for its ViewModel?
Then you should create it when you call the UserControl
from your parent app. It should initialize your ViewModel
and its data, and ilnk it to the UserControl
you're trying to load
Should be enough to get you started!