Addin using WPF

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

Addin using WPF
 
Subscribe
Kevin Du




Posts: 10
Joined: 2017-07-08
I am wondering that is there any possibilty that building the addin using WPF, not Winform? I read the samples in the website, and know that I can add WPF usercontrols into the panel or somewhere, but I can not find how to add WPF windows into my project.
Thank you guys.
Posted 12 Sep, 2017 21:27:32 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
Hello Kevin,

You can add a WPF Usercontrol to your project and then show the UserControl on a pane. Is this what you are looking for?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Sep, 2017 04:28:25 Top
Kevin Du




Posts: 10
Joined: 2017-07-08
Sorry, not exactly. My question is that whether I can add WPF windows into my projects or not, not just UserControls.
Posted 13 Sep, 2017 06:30:49 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
Hello Kevin,

Note that the Add New Item dialog in the Visual Studio IDE doesn't let you add a WPF window to a class library project (an add-in project is a class library). I assume this means the answer is No.

The .NET Framework requires having a WPF application in order for a WPF window to function. In your case, there's no WPF application. We suppose that showing a WPF window may work but we won't be surprised if such a window will work with limitations that you won't be able to overcome.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Sep, 2017 06:52:07 Top
Kevin Du




Posts: 10
Joined: 2017-07-08
OK, I know that then. Thank you.
Posted 13 Sep, 2017 07:00:43 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
Welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Sep, 2017 07:07:28 Top
Gavin Howard




Posts: 6
Joined: 2016-12-01
Hi there - I just wanted to add a little about my own experiences developing an Excel Addin. I have been developing it for my firm over the past year and at a high level it is perfectly possible to design and build an office addin using WPF.

I actually raised a query on this prior to starting the development which you might find useful:

https://www.add-in-express.com/forum/read.php?FID=5&TID=14269

We have developed a perfectly functioning WPF based Excel addin where we used ADX in conjunction with WPF to build panels that can load from the right hand side which render WPF user controls. The fact we don't have a XAML window component has not hindered us at all and we have been able to express all the complexity you would find in a regular desktop app in this panel. Also we have also been able to integrate third party components to bring some of the styling up to date (MahApps.Metro). The only shortcoming were one occasion where a modal dialogue control required a window to render, but we built our own based on some examples in MahApps.

Also by splitting the UI bits out into their own project has allowed us to unit test things like the viewmodels as you would also normally expect.

Hope you find this helpful.
Posted 19 Sep, 2017 05:06:01 Top
Andrei Smolin


Add-in Express team


Posts: 14123
Joined: 2006-05-11
Hello Gavin,

Many thanks!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 19 Sep, 2017 10:00:49 Top