public MainWindow() { InitializeComponent(); if (this.NotInDesignMode()) { _globalData = DIService.GetSingleton<GlobalData>(); _globalData.MainWindow = this; foreach (var contentControl in _globalData.ContentViews) _globalData.SetChildContentViews(contentControl.GetType(), contentControl.FindChildControls<UserControl>()); } }