0

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

Munashe
  • 71
  • 1
  • 8

2 Answers2

1

You can use IsVisibleChanged event:

    private void MainWindow_OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
    {
        if ((bool) e.NewValue == true)
        {
            //DO Stuff
        }
    }
Nitin
  • 18,344
  • 2
  • 36
  • 53
  • I think i now understand whats happening. The MainWindow IS LOADED and IS SHOWN, BUT....the child controls like the menus and toolbars are not yet shown....so how do i check that EVERYTHING is now loaded and visible ? – Munashe Jun 05 '14 at 09:43
  • why do you want it? may be there is some other elegant way of achieving it – Nitin Jun 05 '14 at 09:44
0

I solved my issue by listening for the ContentRendered event instead.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
Munashe
  • 71
  • 1
  • 8