I have a simple Identify Layer tool, that should be displaying information in a popupviewer, however only the Title is being displayed in the PopupViewer Control.
Simplified example is below after following the Configure Clusters sample.
I have tried creating a PopupDefinition in numerous ways but the only thing that displays in the popupviewer is the Title. The rest remains blank. I have to be missing something.
Xaml
<esri:PopupViewer x:Name="popupViewer" Margin="5" Width="375" MaxHeight="400"/>
Xaml.cs
private async void PolkMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e)
{
//Hardcoded the Specific Layer
FeatureLayer _layer = (FeatureLayer)_mapView.Map.OperationalLayers[27] ?? new FeatureLayer();
var results = await _mapView.IdentifyLayerAsync(_layer, e.Position, 3, true);
//Resulting Pop is NOT Null and HAS a PopupDefinition with Fields
var p = results.Popups.First();
if (p != null)
{
popupViewer.Popup = p;
popupViewer.Visibility = System.Windows.Visibility.Visible;
Console.WriteLine("Title " + p.Title.ToString() + " Field count: " + p.PopupDefinition.Fields.Count());
}
}
PopupDefinition (Feature Layer is loaded from a .geodatabase file; Renderer and Label Definitions are created along with the PopupDefinition - only the popup is having issues)
parcelPolyLayer.IsPopupEnabled = true;
PopupDefinition newP = new PopupDefinition() { Title = "My Custom Title"};
PopupField newF = new PopupField() { Label = "Strap", FieldName = "JOIN_STRAP", IsEditable = true, IsVisible = true, StringFieldOption = PopupStringFieldOption.SingleLine };
newP.Fields.Add(newF);
parcelPolyLayer.PopupDefinition = newP;