Book a Demo

Author Topic: Adding Window/Tab is compatible with WPF?  (Read 3180 times)

Tafros

  • EA User
  • **
  • Posts: 25
  • Karma: +1/-0
    • View Profile
Adding Window/Tab is compatible with WPF?
« on: May 30, 2018, 03:47:45 pm »
Hi everyone,

I am trying to add a custom Window/Tab in EAAddin(using wpf).
I used below code it returns null value in wpf, but it works fine in winforms.

public MyCustomWindow eaDockWindow;
 if (this.eaDockWindow == null)
   this.eaDockWindow = Repository.AddTab("Custom Window", "EACustomDockWindow.MyCustomWindow") as MyCustomWindow;

Anyone please assists,whether it is compatible with WPF.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding Window/Tab is compatible with WPF?
« Reply #1 on: May 30, 2018, 06:08:14 pm »
That is because a WPF control is not an ActiveX control (and that is what the doc says you need to supply).

So if you really want to use WPF (why?) you will have to embed it into a winforms control.

See https://stackoverflow.com/questions/11294297/exposing-wpf-control-as-activex-control for more details.

Geert