List related features
List features related to the selected feature.
Related features are useful for managing relational information, like what you would store in a relational database management system (RDBMS). You can define relationship between records as one-to-one, one-to-many, or many-to-one. For example, you could model inspections and facilities as a many-to-one relationship. Then, for any facility feature, you could list related inspection features.
Tap on a feature to select it. The related features will be displayed in a list.
- With a
QueryRelatedFeaturesAsyncon the feature's feature table.
- Iterate over the result's collection of
RelatedFeatureQueryResultobjects to get the related features and add them to a list.
features, identify, query, related, relationship, search
<?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Class="ArcGISRuntime.Samples.ListRelatedFeatures.ListRelatedFeatures" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="150" /> <RowDefinition Height="auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ListView x:Name="MyResultsView" Grid.Row="0" /> <Label x:Name="Status" Grid.Row="1" Margin="5" HorizontalOptions="FillAndExpand" Text="Tap a park (green) to see related features." /> <esriUI:MapView x:Name="MyMapView" Grid.Row="2" /> </Grid> </ContentPage>