Changing the Display Mode brings Viewport to top, C#

Dear Forum,

I’ve encountered an issue that’s pretty difficult to pin down and I’m wondering if anyone can help. I’ve created a C# window using XAML, and an extra floating viewport when my plugin runs. If the viewport is in wireframe mode, then adding geometry to the document and redrawing the doc doesn’t cause the viewport to come to the top. However, now that I’ve changed my viewport’s Display Mode, whenever new geometry gets created and added to the doc, and the doc gets redrawn, the viewport gets automatically made the active window in Windows, and obscures any other windows that might be open. I’ve tested changing the viewport to different Display Modes, and it happens with every display mode except for wireframe, even if I change it to wireframe in the code.

I’m following the sample csmodelessform, but i’m using a xaml window and every now and then I run in to a number of issues with switching control to and from the xaml window and Rhino. Is it possible that Rhino is somehow entering feedback mode? or Rhino thinks that a command hasn’t completed? Please let me know which track I should pursue. Thank you.

Could you post any sample code, so I can see how you are constructing the window? We do exclusive WPF development, and we may be able to help.