Select to view content in your preferred language

Generating property sheet pages programmatically?

142
2
02-10-2025 10:43 AM
Gfreitag
Emerging Contributor

Hi all,

I'm working on a custom add-in that would benefit from being able to generate property sheet pages at runtime, depending on a user's selection. Considering that property sheet pages are declared in DAML, I was wondering if it would be possible to add to/remove pages from my viewmodel.

I thought that GetPlugInWrapper from the FrameworkApplication class might be a good lead, but it seems the best I can do is grab the child elements of a PropertySheet. I feel like I am maybe missing something obvious. Is there a way to add new pages on the fly?

Gfreitag_0-1739212952590.png

Thanks for all the help in previous questions, I really appreciate having a community resource like this when figuring out the SDK.

 

0 Kudos
2 Replies
vanesch
Occasional Contributor

Will Page conditions do the trick? Sheets will drop any Page with a condition that doesn't match the current app state. Hopefully you can specify all your pages but use Conditions/State to only show the relevant ones.

<page id="acmePropertyPage1"
caption="Source" className="acmeViewModel1" condition="acmeCondition_1">

 

0 Kudos
Gfreitag
Emerging Contributor

Thanks for your suggestion @vanesch , unfortunately the pages would depend on the selected polygons of a feature layer, and this feature layer changes over time, so it's impossible to specify all the pages beforehand. 

My idea was to have each page based off of the same View, with the data displayed on each page dependent on the selected polygon's properties. Basically opening the property sheet of the feature layer would show the properties of each selected polygon on a separate page.

I'm realizing this is a bit complex and would perhaps be easier to do in a dockpane... but the layout of a property sheet really lends itself to my problem.

0 Kudos