Hello,
This happens at Rhino 8:
Thank you
Hello,
This happens at Rhino 8:
Thank you
Hi @Eliseo,
Yes, if you have a “per-doc” panel then this is true.
What problem are you trying to solve?
Thanks,
– Dale
Hi @dale ,
First of all, what is the meaning of “per-doc”?
My problem is that a multitude of data is created in the panel, including connections to databases and datasets that cannot be constantly destroyed and created.
The control data must remain as it was before the panel was hidden.
Thanks,
Eliseo
Hi again @dale,
Is there any other way of not to call the destructor and constructor when the form is hidden/shown?
Anyway, the panel is registered as Panel.System like this
Rhino.UI.Panels.RegisterPanel( this, typeof( Interface ), VisibleName( ), Interface.GetControlIcon( 128, 32 ), PanelType.System);
Thanks
That’s my experience as well. In R7 panels are loaded once and unloaded on `RhinoApp.Closing’, but R8 unloads panels each time they become invisible. Hence when docked, activating another panel, unloads your active one.
I’m not a huge fan of this behavior either.
Hi @dale,
in R8, switching between panels using side tabs triggers the OnUnLoad / OnLoad events even when PanelType.System is used. R7 doesn’t behave this way.
Hi @dale
As I told you before, this is the the way I register the panel:
Rhino.UI.Panels.RegisterPanel( this, typeof( Interface ), VisibleName( ), Interface.GetControlIcon( 128, 32 ), PanelType.System);
Any other suggestion?
Hi again @dale ,
I create the Panel with the type System.Panel. My problem is that all the information loaded in the Panel comes from a database. At some operations, the Panel should be hidden but the problem is that when I return to show the panel, the information loaded was deleted.
Is there any other way of hide the panel?
Thanks
The panels come and go and are changed in many behaviors from previous versions of Rhino. Ideally you should separate the backing code and UI logic using something like an MVVM approach. This should help with your data reconstruction issues and work the same way that Rhino’s native panels work. You can technically keep your UI wherever and attach it to the panel when its shown, same for any backing view model.
Can you elaborate @Trav?
I’m experiencing major slowdowns with complex UIs each time a panel is resized because it constantly cycles through unload and subsequent load events.
If I understood your message correctly, you’re suggesting to keep the UI alive somewhere independent of a panel? I’m not talking about the underlying data, just the UI elements.
You can use something like RhinoDoc.RuntimeData and set and fetch things you need. But I do agree that resizing the panel ideally shouldn’t call unload when they are resizing while docked. They don’t get unloaded when floating.
I just peeked at the code and I can see the dock bar controller is reconstructing a table layout on those resizes which is causing the unload/reload issue. Let me do some homework and see if we can improve this.
Thanks! Much appreciated.