Open a new page from Xbap

Our application is a full-featured Xbap. I have a function like this:

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

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

There is an overload that accepts "extraData", but I could not determine what to pass in order to go to a new window.

+3
source share
2 answers

WPF seems to be a bit new to StackOverflow. Here is the function I came across if someone else stumbled upon 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, most likely it only works in full trust.

+3
source

, Full Trust. .

0

All Articles