You can get the number of features in a layer using the Pro API's, FeatureClass.GetCount() method.
var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(n => n.Name == "TestPoly");
QueuedTask.Run( () => {
var featureClass = featureLayer.GetFeatureClass();
var count = featureClass.GetCount();
});