first of all, It is a document based VSTO project (so those add-in VSTO walkthroughs don't really work).
I was able to create an ActionPaneControl and was able to add a WPF usercontrol in it using ElementHost. Code to launch it as the following:
ActionsPaneControl1 apc = new ActionsPaneControl1();
Globals.ThisWorkbook.ActionsPane.Controls.Add(apc);
Globals.ThisWorkbook.ActionsPane.Visible = true;
However, I am trying to pass a parameter into the WPF usercontrol. then I realize that there is no place in the code indicating the WPF usercontrol in this code. My guess is that it has something to do with the ElementHost.
Can anyone help please?
Thank you
EDIT: Here is the ActionPaneControl1 class
partial class ActionsPaneControl1
{
private System.ComponentModel.IContainer components = null;
.....
private void InitializeComponent()
{
this.elementHost1 = new
System.Windows.Forms.Integration.ElementHost();
this.elementHost2 = new
System.Windows.Forms.Integration.ElementHost();
this.ucWPF1 = new SWAPAEMonthlyReview.ucWPF();
.....
}
You can access the WPF UserControl through the
ElementHost
.