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?
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
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.
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.
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?
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!