Application settings
The ArcGIS Mobile application provides a View and Manage Settings page from which you can navigate to each setting page and modify the settings for the application or current project. This topic 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 setting page.
Access existing application settings
The following existing application settings can be accessed from the MobileApplication.Settings property:
- AnimationsEnabled—Check whether animation is enabled and turn animation on and off.
- ApplyOpacity—Check whether opacity is applied and turn application opacity on and off.
- BasemapPaths—Get additional storage paths.
- CurrentSkin—Get the current skin.
- MapPanMode—Get and Set the application map control pan mode.
- MapZoomMode—Get and Set the application map control zoom mode.
- Opacity—Set application opacity.
- OpenGpsOnStartup—Set whether a GPS connection is opened when the application starts.
- OpenLastProjectOnStartup—Check whether to open the last project used.
- ProjectPaths—Additional folder paths for projects.
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 similar to 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());