【发布时间】:2017-03-10 13:12:30
【问题描述】:
我有一个动态创建另一个视图的 UWP 应用。但是,问题是当我关闭第一个窗口时,第二个窗口仍然打开。
使用此代码我正在创建新视图:
CoreApplicationView newView = CoreApplication.CreateNewView();
int newViewId = 0;
await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
Frame frame = new Frame();
frame.Navigate(typeof(SecondPage), null);
Window.Current.Content = frame;
// You have to activate the window in order to show it later.
Window.Current.Activate();
newViewId = ApplicationView.GetForCurrentView().Id;
});
bool viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newViewId);
当用户关闭第一个窗口时如何关闭应用程序?
【问题讨论】:
标签: c# uwp multiple-views application-close