Search code examples
wpfmainwindow

WPF MainWindow Loaded


Which event is triggered in the MainWindow when it now SHOWN and VISIBLE? When I try showing a dialog in the Loaded event, the window would still not be fully loaded/visible


Solution

  • You can use IsVisibleChanged event:

        private void MainWindow_OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if ((bool) e.NewValue == true)
            {
                //DO Stuff
            }
        }