Add-ins that use WPF Pages

Mar 5, 2008 at 9:59 PM
I'm running into the case where my host application is a simple container containing a frame. The goal is that each add-in would be a WPF page that has no dependency on each other. I have tried following the WPF Calcualtor example but when the frame tries to navigate to the page returned from the add-in, it throws an object not set to an instance of an object error.

The contract I am using is as follows:

using System.AddIn.Contract;

[AddInContract]
public interface IPageContract : IContract {
INativeHandleContract GetPage();
}

All the examples I have seen have been dependant on the Framework element being generated in the code-behind and then passed through the pipeline. How would I accomplish this if the object is not defined in the code-behind but its a page in the add-in (ex. addInPage.xaml)
Mar 6, 2008 at 4:22 PM
If anyone is interested I was able to fix the error in my ways. Trying to retrieve a page from the addin seems to be a bad implementation. Instead I decided to encapsulate all my UI functions that an Add-in would need into a API. Once an add-in is activated, the API is passed to the add-in and the add-in uses the API to navigate to the desired page.