private ViewLifetimeControl(CoreWindow newWindow) { CoreDispatcher = newWindow.Dispatcher; WindowWrapper = WindowContext.Current(Window.Current); Id = ApplicationView.GetApplicationViewIdForWindow(newWindow); // This class will automatically tell the view when its time to close // or stay alive in a few cases RegisterForEvents(); }