0

I have a main window in my application which has lot of components and usercontrols. Since this window is taking so long to load, I need to implement a new secondary window(containing buttons for create new, open, recent files etc and details about the application) which needs to be opened in parallel to main window.

since both windows are loading together, the buttons of secondary windows are disabled until the main window is completely loaded. How can I enable the secondary window buttons when the main window is loading in background. Also, can I somehow minimize the main window alone even though its loading in background?

Any solution or idea, suggestion for advanced features are welcome. Thanks in advance.

abhijith
  • 1
  • 1
  • 1
    I think that those links can help you find your solution - https://stackoverflow.com/questions/44722639/open-two-forms-at-the-same-time , and - https://www.codeproject.com/Questions/564727/Howplustoplusplusopenplustwoplusplusformsplusatplu – aca Jun 13 '22 at 11:49

1 Answers1

0

in your MainWindow constructor:

public MainWindow()
{
    InitializeComponent();

   Task.Run(() =>
   Dispatcher.Invoke(() => {    
   YourSecondWindow secondWindow = new YourSecondWindow();
   secondWindow.Show();}));
}
Роман
  • 13
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 13 '22 at 22:01