private void VisibilitySwitch_ValueChanged(object sender, EventArgs e)
{
// Get the row containing the UISwitch that was changed
var index = (sender as UISwitch).Tag;
// Set the sublayer visibility according to the UISwitch setting
var sublayer = sublayers[(int)index] as ArcGISMapImageSublayer;
sublayer.IsVisible = (sender as UISwitch).On;
}