I have a user control that I load into a MainWindow
at runtime. I cannot get a handle on the containing window from the UserControl
.
I hav
I'll add my experience. Although using the Loaded event can do the job, I think it may be more suitable to override the OnInitialized method. Loaded occurs after the window is first displayed. OnInitialized gives you chance to make any changes, for example, add controls to the window before it is rendered.