Draw overlay problem

Rhino 6 .I have a command that uses a subclass of MouseCallback. With the following call:
DisplayPipeline.DrawOverlay += (new System.EventHandler(ConduitDraw));
i can display my objects when i redraw active view , but i saw debugging that if i start grasshopper (if i keep grass window open or closed) this call does not work anymore.

Could you upload the simplest version of that command which shows the problem?

Yes, sure, thank you. Now I am with my son, but in two hours i will be back to my office

Hi David.
I send to you a project that works !!!.

thanks to it i found the problem.

In the original project i forgot to insert in try catch a call to a wpf window. The code entering the “main” try catch did not activate the drawoverlay !!!
I wrote a comment in line 24 of test_draw.cs

So the problem remains the first i have when i open grasshopper and i try to use wpf windows. In the project there is another command, “TestWpf” that try to open a wpf window. In that command grasshopper does not affect the result but i think it is the starting point to solve the problem.

Forgetting the first question about draw verlay that was not a problem i am tring to undestand what happens with wpf windows. In my project i did not use images for controls as in this test project (because as you can see it would fail), i punt images in a folder of the project and in the xaml i use this:

In this way ,if i don’t open grasshopper , wpf windows work well. After opening grasshopper i cannot open wpf windows anymore.

In the following link there are two videos : https://discourse.mcneel.com/t/wpf-window/74782

Here there is the project https://drive.google.com/open?id=1Oa53XizH1imKSYZDnkna2gn1NGR775Cp

Hi David. I found the problem. It was a gha project that was running with the same name of the rhp. only the last letter was Uppercase instead of lowercase. If I leave them togheter, the windows of the rhp don 't work.