I have created a customized ObjectPropertiesPage and its PageControl will be updated (via overriding UpdatePage()) when selected object changes.
Here is a problem it is kind of randomly occurring: it seems the panel is not rendered/refreshed correctly sometime. It will show up correctly until the cursor moves above or re-select the rhino object.
@mingo1214 just taking a guess here but does the panel that gets returned from those PanelHelper methods have any dimensions? If not, try setting your panels size to some value like 100x200 and see if they get more responsive. You might consider using a backing viewmodel and constructing the UI one time and using the view model bindings to enable/disable various elements or do the panel swapping.
@Trav I also just did some additional quick tests with two simple view models. It definitely improves the situation, but only happens with less frequency. I’d say it happens 1 out of 10 clicks on different objects, where as the previous situation is 2-3 times out of 10.
So, the good news is that your code runs perfectly on my system. The bad news is I am thinking that your systems might be suffering the same issues that these were in the link below. Does your UserText panel refresh correctly or are there any problems with any other panels on your machines?
Hi @Trav, thanks so much for testing out. I have no issue with UserText panel or other panel doesn’t show correctly.
It is totally fine on my computer when selecting one brep to another one, which what you are doing in your video. Did you try to select between a sub-surface and the brep? (please see my above video) That’s when issues occurred on my machine.
I am testing the view model for a day now, kind of get rid of the issue with a view model added. But I will do more tests with view model to see if issues remain.
@mingo1214, @JohnM and I chatted about your situation for a moment and we’re leaning towards my first hunch that it’s a code performance issue since you are not seeing any issues with other ETO panels. As I had mentioned earlier your panel code is doing a lot of repetitive work that it probably should not be tasked to do. To complicate things further its creating different UI for each object type. You could definitely improve the UI performance by creating a panel ui for each object type and reusing that ui when those objects are selected. That may be enough to stop the issue on a slower device. If anything its a good thing to do regardless to be more efficient.
That’s a good solution. You could also have both UI’s sitting in preloaded panels and just change the main pages Content to the required panel. Then just let the viewmodel know about the currently selected document and selected objects.