Application settings
The ArcGIS Mobile application provides a Settings page from which you can navigate to each setting page and modify the settings for the application or current project. This section details how to access application settings within the application framework, create a new setting page, and add an entry for the new setting on the Application Settings page.
Access existing application settings
Existing application settings can be accessed from the MobileApplication.Settings properties.
- AnimationsEnabled: Check whether animation is enabled and turn on/off animation.
- ApplyOpacity: Check whether opacity is applied and turn on/off application opacity.
- ArcGISPaths: Get additional storage paths.
- CurrentSkin: Get the current skin.
- MapPanMode: Get/Set the application map control pan mode.
- MapZoomMode: Get/Set the application map control zoom mode.
- Opacity: Set application opacity.
- OpenGpsOnStartup: Set whether a GPS connection should be opened when the application starts up.
An event handler, OnPropertyChanged, is raised when a setting is changed.
void Settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { ESRI.ArcGIS.Mobile.Client.Windows.MessageBox.ShowDialog(e.PropertyName + " changed."); }
Add a setting page
In some cases, you might want to add a setting page for your task or project extension. Basically, a setting page is a MobileApplicationPage with an ISettingsPage interface; it has a title, note, page icon, back button, and forward button as other pages in the application.
public partial class MySettingPage : MobileApplicationPage, ISettingsPage { ... }
This new setting page needs to be added to the MobileApplication.SettingsPages property, which is a collection of setting pages; a button then is added to the application settings page for your setting page.
MobileApplication.Current.SettingsPages.Add(new MySettingPage());
For more details about application settings and how to create a new setting page, refer to the SettingsExtension sample.