MessageBox in netcore

Hi, i am migrating to netcore.
i have all my messageboxes with Eto like the following example Eto.Forms.MessageBox.Show(Rhino.UI.RhinoEtoApp.MainWindow, “Under Construction”);
If i am not wrong there is not Eto for netcore and i think to pass to System.Windows.MessageBox.Show(System.Windows.Application.Current.MainWindow, “Under Construction”); but this is not working, the owner is not rhino. I am trying in netframewrok, probably in net core it will works?

Rhino 8 GUI is much Eto, it all definitely works with .NET 7.

Ok, now i know that rhino uses a lot Eto, but i don’t know how to use messagebox. Please , in rhinocommon c# how do i have to change this?Eto.Forms.MessageBox.Show(Rhino.UI.RhinoEtoApp.MainWindow, “Under Construction”);
I don’t find something similar to Rhino.UI.RhinoEtoApp.MainWindow . Thank you very much for your time

Rhino.UI.RhinoEtoApp.MainWindow should work still just fine. At least it is in Rhino code itself used quite a bit.

So probably i need to add a reference that i don’t know, what is the reference?

On Windows that would be RhinoWindows.dll on the Mac RhinoMac.dll

Ok thank you again but Rhino.Ui.RhinoEtoApp.MainWindow ?

  1. Is existing Rhino.UI.RhinoEtoApp.MainWindow? I don’t think so.
    2)I can add RhinoWindows.dll and change to winform for messageboxes like this: System.Windows.Forms.MessageBox.Show(RhinoWindows.RhinoWinApp.MainWindow, “sometext”);
    3)but: RhinoWinApp.MainWindow is IWin32Window, it is good for System.windows.Forms.MessageBox.Show(…,), it is not good for System.Windows.MessageBox.Show(…,) the parameter in this case should be System.Windows.Window. There is no problem, i can change it, i will have 700 messageboxes but i can do that with refactoring someway. but…
  2. isRhinoWindows.dll good for netcore? because if you see the image it seems to be only for netframework.
    .
    I don’t have the chance to try it because I can’t compile my project yet, otherwise I’d rather not waste people’s time

@gianfranco74 Seems I don’t quite follow your dots in this issue, however, overall maybe the issue is somewhere else ? Try checking this and this, maybe things will clear up a bit for you.

Otherwise, I’m not sure if this will work for you but it was ok for WPF custom windows:

var someDialog = new Controls.SomeDialog();
someDialog.ShowInTaskbar = false;
new System.Windows.Interop.WindowInteropHelper(someDialog).Owner = Rhino.RhinoApp.MainWindowHandle();

//ShowDialog or sth else suitable for you

However, this does not solve anything for Mac.

My plugin is only for windows and yes that is the way i use to show my wpf windows in rhino .For MessageBoxes i had Eto.Forms.MessageBox.Show(Rhino.UI.RhinoEtoApp.MainWindow, “Under Construction”); now it is wrong.

Mhm. As I said it’s worth checking those topics which I left above.

Couldn’t you just use this: https://developer.rhino3d.com/api/rhinocommon/rhino.ui.dialogs/showmessage to show message boxes?

If you scroll a bit down for instance this signature: public static ShowMessageResult ShowMessage( String message, String title, ShowMessageButton buttons, ShowMessageIcon icon )

Thank you very much , i will try it as soon as visual studio 2022 installing new version will end. if someone needs to change modifiers of Properties.Settings.Default from internal to public there is a bug in VisualStudio ,see this: Developer Community . Please can you also tell me if RhinoWindows.dll is good for netcore or only for NetFramework? and if is Rhino.UI.RhinoEtoApp existing in netcore? and if not, is there something that gives the property of Rhino.UI.RhinoEtoApp.MainWindow?