private void Initialize()
{
// Create new Map
Map myMap = new Map();
// Create the uri for the tiled layer
var tiledLayerUri = new Uri(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer");
// Create a tiled layer using url
ArcGISTiledLayer tiledLayer = new ArcGISTiledLayer(tiledLayerUri);
tiledLayer.Name = "Tiled Layer";
// Add the tiled layer to map
myMap.OperationalLayers.Add(tiledLayer);
// Create the uri for the ArcGISMapImage layer
var imageLayerUri = new Uri(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer");
// Create ArcGISMapImage layer using a url
ArcGISMapImageLayer imageLayer = new ArcGISMapImageLayer(imageLayerUri);
imageLayer.Name = "Image Layer";
// Set the visible scale range for the image layer
imageLayer.MinScale = 40000000;
imageLayer.MaxScale = 2000000;
// Add the image layer to map
myMap.OperationalLayers.Add(imageLayer);
// Create Uri for feature layer
var featureLayerUri = new Uri(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/FeatureServer/0");
// Create a feature layer using url
FeatureLayer myFeatureLayer = new FeatureLayer(featureLayerUri);
myFeatureLayer.Name = "Feature Layer";
// Add the feature layer to map
myMap.OperationalLayers.Add(myFeatureLayer);
// Create a map point the map should zoom to
MapPoint mapPoint = new MapPoint(-11000000, 4500000, SpatialReferences.WebMercator);
// Set the initial viewpoint for map
myMap.InitialViewpoint = new Viewpoint(mapPoint, 50000000);
// Event for layer view state changed
MyMapView.LayerViewStateChanged += OnLayerViewStateChanged;
// Provide used Map to the MapView
MyMapView.Map = myMap;
}