从 Xbap 打开新页面

发布于 2024-07-09 07:37:47 字数 327 浏览 5 评论 0原文

我们的应用程序是完全信任运行的 Xbap。 我有一个与此类似的功能:

private void ShowPage(Page page)
{
    NavigationWindow mainWindow = Application.Current.MainWindow as NavigationWindow;  
    mainWindow.Navigate(page);
}

这对于在现有窗口内浏览非常有用。 我想在单独的窗口中打开这个新页面。 有办法做到这一点吗?

有一个重载需要“额外数据”,但我无法确定要传递什么来导航到新窗口。

Our application is an Xbap running in full trust. I have a function similar to this:

private void ShowPage(Page page)
{
    NavigationWindow mainWindow = Application.Current.MainWindow as NavigationWindow;  
    mainWindow.Navigate(page);
}

This works great for browsing inside an existing window. I would like to open this new page in a separate window. Is there anyway to do this?

There is an overload that takes 'extraData' but I haven't been able to determine what to pass to navigate to a new window.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满意归宿 2024-07-16 07:37:47

显然 WPF 对于 StackOverflow 来说有点新鲜。 这是我想出的函数,以防其他人偶然发现这个。

private void ShowPage(Page page)
{
    NavigationWindow popup = new NavigationWindow();  
    popup.Height = 400;
    popup.Width = 600;
    popup.Show();
    popup.Navigate(page);
}

我还没有在部分信任的情况下尝试过这个,很可能这只在完全信任的情况下有效。

Apparently WPF is a little new for StackOverflow. Here is the function I came up with in case anyone else stumbles across this.

private void ShowPage(Page page)
{
    NavigationWindow popup = new NavigationWindow();  
    popup.Height = 400;
    popup.Width = 600;
    popup.Show();
    popup.Navigate(page);
}

I have not tried this in partial trust, it is likely this only works in full trust.

誰認得朕 2024-07-16 07:37:47

你是对的,这只适用于完全信任。 您无法在部分信任的情况下创建弹出窗口。

You are correct that this would only work in Full Trust. You cannot create a popup in partial trust.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文