WpfBaseApp2 ( WPF )

Objectives:
  • Unmanaged Window without "App.xaml"
    • FYI :  App.xaml file connects and maintain Life-Cycle of WPF windows.
  • [STAThread()]
    static void Main()
  • Application app = new Application();
    Window window = new Window();
    Start_Up st = new Start_Up();
  • Code : MainWindow.xaml.cs.txt, App.xaml.txt
Step:1 Create a New project

Step:2 Now Remove "App.xaml" and Edit Code in "MainWindow.xaml.cs" . You may create App.xaml using this code App.xaml.txt.

The view before editing the contents in MainView

The after editing the contents in MainWindow (MainWindow.xaml.cs.txt )

Step:3 Runtime views

a) Creating, Opening and Running Two windows ( The close handle, close the current window, but does not close the application

b) Clsoing with "Close Menu')

Note the Base Window is still running

Now use "Close" menu in the Base Window. The Close menu (now in contrast to previous application, WpfBaseApp1.htm ) merely close the window, leaving "WpfBaseApp2" Application still Running in the background.