

The only thing that has had any success is calling but I am not sure if that is allowed either, though it throws no exception. But I didn't think it would be necessary anyway since the user clicked on close. To call Close on the main window again without exception saying that is not allowed. This sometimes work if I step though the code, but if I run it otherwise all the windows disappear but there remains an icon on task bar and I believe a window is still alive though hidden. ApplicationView.GetForCurrentView().Consolidated += App_Consolidated and in that method looping through the CoreApplication.Views collection and closing I have tried subscribing to the mainviews consolidated event in App.xaml when creating the app. I cannot use suspending since there is no way to determine if the user is terminating the app or it is suspending for another reason. So far I have been unable to accomplish this.įirst I tried to handle the closed event for the main window, but it is never fired.

This functionality is present in the built in Calendar app. However, if the user manually closes the main view of the app I want to close all of the child views as well. I am also able to successfully close one of the new views when the user chooses to. I am able to successfully create the window with CoreApplication.CreateNewView. The user of my application can create a new window/view in certain situations.
