Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Issue: Messagebox hidden [22192]

$
0
0
I have a WPF application embedded in a third-party software. My WPF app only has user controls and no windows at all. What does happen is if I call XCeed.Wpf.Toolki.Messagebox.Show(...), click on any other opened app and come back to mine, then the messagebox is hidden behind and it is pretty hard to bring it back. I must kill my app because it his waiting for the user to take action on a hidden messagebox.

I then tried to create an instance of the class and call ShowDialog and play with events, but there is no button, icon and defaultButton properties???

How could I get this messagebox working like the default Windows one? It is almost perfect, unless we click on another app and then we must kill it.

Thank you
Comments: ** Comment from web user: BoucherS **

Hi,
v2.4, v2.5 and v2.6 have the issue.
v2.7 and up are fixed.

There is no workaround, but a fix could be :
In file Xceed.Wpf.Toolkit/MessageBox/Implementation/MessageBox.cs
In method "CreateContainer()"
Add :
```
newWindow.Owner = _owner ?? ComputeOwnerWindow();
```
Where ComputeOwnerWindow() is
```
private static Window ComputeOwnerWindow()
{
Window owner = null;

if( Application.Current != null )
{
foreach( Window w in Application.Current.Windows )
{
if( w.IsActive )
{
owner = w;
break;
}
}
}
return owner;
}
```


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>