I have added WindowLoaded event as a routed event handler in constructor but not sure if this is a right way of declaring/suing loading of a window.
this.AddHandler(Window.LoadedEvent, new RoutedEventHandler(WindowLoaded));
Currently seems working since as soon as I run the App I get a empty window with borders only without its contents.
Question is that how can I use WindowLoaded() event in WPF? I was expecting to select it from top dropdown box in VS2010 but I guess have to enter it manually. Is that right?
Cheers,
Amit
You can follow Mark’s advice, or alternatively, you can add the loaded event in your
MainWindow.xaml(Visual Studio will generate the handler for you if you press ctrl+space in the Loaded attribute):