BackStage_PropertyPage sample

49
3
06-22-2018 11:11 AM
Highlighted
Regular Contributor

Hi,

I have the BackStage_PropertyPage sample compiled and running in ArcPro.  In that sample, there is a checkbox called 'GeneralSetting' that resides in "Options - Application - Sample App Settings".

I am trying to access the value of that checkbox through a completely different tool.

How do I do that??

Thanks,

Tags (2)
Reply
0 Kudos
3 Replies
Highlighted
Regular Contributor

Hi Brian,

Open settings module class file (in BackStage_PropertyPage sample Module1.cs) and find  internal Dictionary<string, string> Settings

Replace internal with public

Add reference of settings module to your tool project if it separate project.

From your other tool find module with settings:

Module1 modOwner = Module1.Current;

Use module Settings property to access your settings:

modOwner.Settings.  

Highlighted
Regular Contributor

Hi,

Thanks for responding.  I can't seem to get your method to work, but alternatively what I am doing is just building all of my tools in the same project as my 'Property Sheet'.  Not the most ideal solution, but the easiest way to get around the problem.

All I need to do now is access Properties.Settings.Default.<the setting> to access the value.

Reply
0 Kudos
Highlighted
Regular Contributor

Hi Brian,

I have not read carefully your question. I thought that you asking about Project properties. Application properties you can access using :

BackStage_PropertyPage.Properties.Settings settings = BackStage_PropertyPage.Properties.Settings.Default;
bool bGeneral = settings.GeneralSetting;
It works from add-in button in the same project.
Reply
0 Kudos