I’m integrating Rhino dialogs into a WPF add-in and I’m hitting a strange issue with window modality.
Here’s the code I’m using:
internal static bool GetColor(System.Windows.Window owner, out Color color)
{
var pick = new Rhino.Display.Color4f();
if (Rhino.UI.Dialogs.ShowColorDialog(owner, ref pick, false))
{
var picked = pick.AsSystemColor();
color = Color.FromArgb(255, picked.R, picked.G, picked.B);
return true;
}
else
{
color = Color.Empty;
return false;
}
}
When I call this from a WPF window, the Rhino color dialog works and returns the expected color.
However, after it closes, all my dialogs lose their owner relationship they are no longer modal.
I can freely move and interact with other windows that should still be blocked by the active dialog.
Has anyone seen this behavior? Is there a reliable way to show Rhino.UI.Dialogs.ShowColorDialog from a WPF owner window without breaking window modality afterwards?
Thanks!