Update Custom ObjectPropertiesPanel without change object selection

Hello Everybody,

I managed to get a custom Object PropertiesPanel (realized following SampleCsEtoPropertiesPage.cs) show up when a Rhino Object with my Plugin’s User Data attached to it is selected.

Now my Plugin has some methods to update these Rhino Object’s User Data without changing their selection state. When the User Data is changed that way and possibly my custom ObjectPropertiesPanel is visible, I would like to update it accordingly.

My “quick and dirty” approach would be to deselect and reselect the current selection for the PropertiesPage’s UpdatePage to fire - but is there maybe a more elegant way to access and update my Custom ObjectPropertiesPage?

Maybe @dale, can you help me here?

Thank you!

Hello again,

I think I got it working inbetween - although I’m not sure if my solution is especially elegant… So please, if you have any comments on how to handle this in a nicer way, please tell me :slightly_smiling_face:

I’m adding a private set property to the plugin’s class and in the overridden ObjectPropertiesPages function, I’m handing the custom ObjectPropertiesPage to it.
After changing the objects, I can access the plugin-wide property via the plugIn instance and after checking if the page exists (was opened at least once), I can adjust it’s content.

Hi @romio82,

In general, there should be a view model bound to the view and the controls on it. When the properties of the view model change, you would see if anything worthy has change then call your ObjectPropertiesPage.ModifyPage implementation.

– Dale

Hi @dale,

thank you for the immediate reply!

Unfortunately I didn’t come across the term “view model” until now- is it somthing like the content of this thread?
And is the sample maxsoder refers to the one I should deal with to try to understand?

Thank you!

… or do you by chance have a code sample for a view model connected to an ObjectPropertiesPage that I could examine? That would be awesome of course! :wink:

Hi @romio82,

I don’t believe I have an example of this, specifically. But I can make something up given a day or two.

– Dale

Oh, wow, @dale, thank you for that kind offer!
I tried to wrap my head around what I found about view models here in the forum, but I didn’t quite get it yet.

Maybe an Eto sample involving a view model would also be a valuable addition to the sample collection?

So, if you find some time for it, I would be very greatful!

Thank you!

Hi @dale,

for sure you have way more important things to do
and I definitely don’t want to cause any kind of unnecessary stress…

I’m just quite curious on how these things are done the right way and wanted check if you already have something in the making?