Select to view content in your preferred language

Using ModuleSettingsReader and ModuleSettingsWriter outside of Module class

1843
1
10-23-2024 06:24 AM
JFr87
by
Occasional Contributor

Hi,

in the Module class of an AddIn, you can save and read your own project settings by overwriting OnWriteSettingsAsync and OnReadSettingsAsync. Is it possible to use the ModuleSettingsReader and ModuleSettingsWriter passed as parameters in these methods in a different way? I want to be able to use ModuleSettingsReader and ModuleSettingsWriter outside of the Module class. The reason for this is that I want to write and read these project settings not only when saving or loading the project, but also when opening and closing a separate window, for example. I haven't been able to find an example of this yet.

Thanks in advance

0 Kudos
1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

Look at the BackStage_PropertyPage sample. Open ProjectSettingsViewModel.cs file. Look inside InitializeAsync() and CommitAsync() methods how you can access and modify project settings. If you need to save changes right now, you can call :

await Project.Current.SaveAsync();

  

0 Kudos