It looks like the InMemoryFeatureLayer is getting set to me. Here is my latest code, using AreaStyles.CreateSimpleAreaStyle() as directed.
InMemoryFeatureLayer imfl;
foreach (var layer in xmlView.LayerDescriptors)
{
imfl = new InMemoryFeatureLayer();
imfl.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle((layer.DefaultAreaStyleDescriptor.ToInstance() as AreaStyle).FillSolidBrush.Color);
imfl.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = (LineStyle)layer.DefaultLineStyleDescriptor.ToInstance();
imfl.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
imfl.Name = layer.LayerName;
foreach (string f in layer.ShapeTexts)
{
var nf = new Feature(f);
imfl.InternalFeatures.Add(nf);
}
this.Layers.Add(imfl);
}
And here is the state of both layer.DefaultAreaStyleDescriptor.ToInstance() and imfl.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle from the VS2015 Immediate window.
layer.DefaultAreaStyleDescriptor.ToInstance()
{ThinkGeo.MapSuite.Core.AreaStyle}
Advanced: {ThinkGeo.MapSuite.Core.AreaStyleAdvanced}
CustomAreaStyles: Count = 0
FillSolidBrush: {ThinkGeo.MapSuite.Core.GeoSolidBrush}
IsActive: true
Name: ""
OutlinePen: {ThinkGeo.MapSuite.Core.GeoPen}
PenBrushDrawingOrder: BrushFirst
RequiredColumnNames: Count = 0
XOffsetInPixel: 0
YOffsetInPixel: 0
imfl.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle
{ThinkGeo.MapSuite.Core.AreaStyle}
Advanced: {ThinkGeo.MapSuite.Core.AreaStyleAdvanced}
CustomAreaStyles: Count = 0
FillSolidBrush: {ThinkGeo.MapSuite.Core.GeoSolidBrush}
IsActive: true
Name: ""
OutlinePen: {ThinkGeo.MapSuite.Core.GeoPen}
PenBrushDrawingOrder: BrushFirst
RequiredColumnNames: Count = 0
XOffsetInPixel: 0
YOffsetInPixel: 0
(layer.DefaultAreaStyleDescriptor.ToInstance() as AreaStyle).FillSolidBrush.Color
{ThinkGeo.MapSuite.Core.GeoColor}
AlphaComponent: 180
BlueComponent: 225
GreenComponent: 105
Hue: 225
IsTransparent: false
Luminance: 0.5686275
RedComponent: 65
Saturation: 0.727272749
imfl.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.FillSolidBrush.Color
{ThinkGeo.MapSuite.Core.GeoColor}
AlphaComponent: 180
BlueComponent: 225
GreenComponent: 105
Hue: 225
IsTransparent: false
Luminance: 0.5686275
RedComponent: 65
Saturation: 0.727272749
If nothing looks wrong with this code I’ll create a simple sample in the morning. (+6 GMT here)