Here's an example that shows some simple conditional logic to determine when shapefile contents need to be displayed as graphics or features. It is important to note that QueryAsync will load the entire shapefile into memory, so as Morten mentioned, memory consumption can be an issue. The code example also shows how to limit the number of features returned using the MaximumRows property. You can use this technique to control the number of features, and thus memory, used in your application.
Esri.ArcGISRuntime.Data.ShapefileTable table = await Esri.ArcGISRuntime.Data.ShapefileTable.OpenAsync(filename);
if (table.SpatialReference != mv.SpatialReference)
{
var items = await table.QueryAsync(new Esri.ArcGISRuntime.Data.QueryFilter() { MaximumRows = 1000});
GraphicsOverlay overlay = new GraphicsOverlay()
{
GraphicsSource = items.Select(f => new Graphic(f.Geometry, f.Attributes)),
RenderingMode = GraphicsRenderingMode.Static
};
// Define renderer for graphics overlay
// overlay.Renderer = sr;
mv.GraphicsOverlays.Add(overlay);
}
else
{
FeatureLayer layer = new FeatureLayer(table);
mv.Map.Layers.Add(layer);
}