Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Staff
Posts: 99
Registered: ‎02-10-2017
Accepted Solution

GeoMedia custom modal command

Hi!

 

I'm creating a custom modal command, with WPF, for GeoMedia.
When I have the command opened and if I open a different application, for instance a browser window, and try to go back to GeoMedia, my custom command isn't available anymore and GeoMedia gets stucked.
I need to kill the process in task manager and if i do that, all the work that wasn't saved, will be lost.

 

Any suggestions to overcome this situation?

 

TIA

Highlighted
Technical Evangelist
Posts: 551
Registered: ‎09-11-2015

Re: GeoMedia custom modal command

Hi,

 

I am not familiar with WPF, however, try to set the parent of your dialog to Application.AppMainhWnd, if possible. It should fix the problem.

 

Pavel

Highlighted
Staff
Posts: 99
Registered: ‎02-10-2017

Re: GeoMedia custom modal command

Hi Pavel.

 

Thanks.

 

I tried a workarround that solved my problem.

 

I overrided the OnActivated event so that I can set the window Topmost property to true and then immediatly set to false again:

 

protected override void OnActivated(EventArgs e)
{
base.OnActivated(e);

this.Topmost = true;
this.Topmost = false;
}

 

Best regards