Clyde Eisenbeis

Clyde Eisenbeis

  • 1.7k
  • 63
  • 11.8k

What executes commands after the wpf image is displayed? - continued

Mar 7 2024 3:47 PM

My "Reply" to the replies to my initial question - c-sharpcorner.com/forums/what-executes-commands-after-the-wpf-image-is-displayed - was not displayed.  I'll reply here.

I finally realized which response was easiest to implement.

----------

Replace this

<Window x:Class="Cities.MainWindow"
        ...
        WindowStartupLocation="CenterScreen" 
        Loaded="Window_Loaded" >
//------------------------------
private void Window_Loaded(object sender, RoutedEventArgs e)
{
    FillListBoxes();
}
//------------------------------

----------

with this

<Window x:Class="Cities.MainWindow"
        ...
        WindowStartupLocation="CenterScreen" 
        Loaded="Window_ContentRendered" >
//------------------------------
private void Window_ContentRendered(object sender, EventArgs e)
{
    dlgNumbers dlg = new dlgNumbers();
    dlg.ShowDialog();
    FillListBoxes();
}
//------------------------------

Thanks to Jayraj Chhaya, Naimish Makwana, Amit Mohanty!

 

 

 

 


Answers (3)