C# WPF "InitializeComponent() does not exist" Problem after imported Dynamo ProtoGeometry.dll

C# WPF "InitializeComponent() does not exist" Problem after imported Dynamo ProtoGeometry.dll

zefreestijl
Advocate Advocate
2,494 Views
2 Replies
Message 1 of 3

C# WPF "InitializeComponent() does not exist" Problem after imported Dynamo ProtoGeometry.dll

zefreestijl
Advocate
Advocate

zefreestijl_0-1632750058926.png

Hi, 

 

all the codes related to WPF got messed up after I referenced Dynamo ProtoGeometry library. 

 

I've tried different WPF sample files, and all has the same issue.

so I thought the problem might be caused by the settings in the IDE?

 

But when I registered an add-in tool for the wpf app, 

the Dynamo will also be malfunctioned.

 

zefreestijl_1-1632750679538.png

 

It shouldn't effect the app inside Revit if the issue was caused by Visual-Studio's IntelliSense.

 

If anyone knows what's going on here.

please help me solve this.

 

Thanks in advance.

0 Likes
Accepted solutions (1)
2,495 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor
Accepted solution

Certain parts of Dynamo inherit Windows class objects. I don't know that items within proto geometry do this but the custom node views do. 

 

Check you x:class attribute in Xaml there is probably some conflict with that.

 

Also your InitializeComponent should be first call, there is nothing you should be doing in ctor before that.

 

If you load Revit with an Addin that references different versions of components than those the Dynamo in Revit is using it will create conflicts. Dynamo usually notes the conflicts. Mixing Dynamo references in a pure Revit API addin usually just creates a mess or creates something that works but only for a year (until next version of Dynamo).

Message 3 of 3

zefreestijl
Advocate
Advocate
Hi Thomas, Thanks for your quick response,

I've just figured out the Dynamo messed problem in my second image,
it's because I tired to register multiple window ui into one app,
after I split them up the Dynamo inside Revit back to normal.

Though the ProtoGeometry library import issue still not solved,
but since you mentioned the conflict issue between each version...

I was thinking Dynamo is open source so the function could
be implemented outside the environment without executing the program...
now I think I won't spend more time on fixing the reference and
will focus on reproduce the code from scratch.


Thanks again for your nicely explanation.  
0 Likes