// Create a new colorizer definition using default constructor.
StretchColorizerDefinition stretchColorizerDef = new StretchColorizerDefinition();
var rasterLayerCreationParams = new RasterLayerCreationParams(new Uri(url))
{
Name = layerName,
ColorizerDefinition = stretchColorizerDef,
MapMemberIndex = 0
};
await QueuedTask.Run(() =>
{
// Create a mosaic layer using the colorizer definition created above.
// Note: You can create a mosaic layer from a url, project item, or data connection.
MosaicLayer newMosaicLayer =
LayerFactory.Instance.CreateLayer<MosaicLayer>(rasterLayerCreationParams, aMap);
});