Domanda

Hi i need to create desktop application instead xbap application with the same functionality as it was in xbap application. I am wondering it is possible to embed it in wpf application and how it will work.

È stato utile?

Soluzione

Yes you can do it. And it is quite easy but it can be done in many ways. You can create a dll from you current xbap application but just take the necessary. And create a new WPF application project then just add the reference to the xbap dll that you just made. And then you can use the controls/pages you made in the wpf application

Or you can look at this : http://zainco.blogspot.ca/2009/01/converting-xbap-to-wpf-application.html or http://davidsandor.com/post/2009/07/17/Convert-a-WPF-Browser-Application-project-to-a-WPF-Application.aspx

EDIT 1:

In the code behind of the MainWindow you can do something like this.

/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        this.Content = new Page1(); <--- The start page of you xamp application in the dll file.
    }
}

Or you can use a NavigationWindow look at this : http://www.c-sharpcorner.com/UploadFile/0f100d/navigation-window-based-application-in-wpf/

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top