private async void Button_Click(object sender, RoutedEventArgs e)
{
CoreApplicationView newView = CoreApplication.CreateNewView();
int newViewId = 0;
await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
Frame frame = new Frame();
frame.Navigate(typeof(SecondaryPage), 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);
}
2 回答
对的,这是可能的 . 您想创建新视图并切换到此新视图 .
或者你可以打开Popup控件 .
这两种方法的区别在于Popup控件将始终覆盖应用程序窗口 . 可以将新视图移出应用程序窗口边界 .
相关链接:
Show multiple views for an app
Popup code example
干得好,
你的代码
About Button Click
您可以在 AboutUs 页面中提供有关您的应用的信息
您需要将
contentDialogAboutUs
声明为静态,以便可以在 AboutUs 页面中将其用于关闭 .在AboutUs页面中,关闭你的“弹出窗口”,
HomePage是我调用AboutUs click的源页面 .
希望这对你有所帮助 .