Reusing WPF Task Panes of our existing Word Addin

Add-in Express™ Support Service
That's what is more important than anything else

Reusing WPF Task Panes of our existing Word Addin
 
Sujay Ghosh




Posts: 13
Joined: 2010-01-20
Hello There ,

We have an existing Word addin, which uses WPF for the task panes.

Is there a way to use the existing WPF task panes with Add in Express .

Please let us know.

Thanks
Sujay
Posted 12 Nov, 2020 10:10:23 Top
Andrei Smolin


Add-in Express team


Posts: 17493
Joined: 2006-05-11
Hello Sujay,

Drop an ElementHost component onto the pane. The component allows you to reuse WPF UserControls.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 12 Nov, 2020 10:46:06 Top
Sujay Ghosh




Posts: 13
Joined: 2010-01-20
Hello Andrei,

Thank you .

The existing project has the WPF user controls as .xaml files, and they dont show up in ElementHost .

I created a new solution , which has two projects - 1) the ADX Task Pane , and 2) a simple WPF user control ( dll ).

When I add the reference of the dll ( WPF user control ), it does show up in the ElementHost of Adx Task Pane. My question is ; for displaying a WPF user control in the element host, must we create a DLL for the user controls

In our case if we create a DLL for the WPF user control, then we have to split our existing code into two parts - UserControls and the Logic.

Is there a simpler way to get this done .

Thank you .

Sujay
Posted 12 Nov, 2020 12:19:32 Top
Andrei Smolin


Add-in Express team


Posts: 17493
Joined: 2006-05-11
Hello Sujay,

Sujay Ghosh writes:
My question is ; for displaying a WPF user control in the element host, must we create a DLL for the user controls


No, a separate DLL holding such a WPF UserControl is not required. In my tests, the UserControl was located right in the add-in project.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2020 00:57:34 Top
Sujay Ghosh




Posts: 13
Joined: 2010-01-20
Hello Andrei ,

Thank you , I was able to address the problem .

Thanks
Sujay
Posted 13 Nov, 2020 01:30:17 Top
Andrei Smolin


Add-in Express team


Posts: 17493
Joined: 2006-05-11
You are welcome.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2020 01:31:13 Top