below code using to zoom to feature at street level. When click feature its taking 3 clicks to zoom to street level . And also viewModel_PropertyChanged method triggering twice
async void viewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (isMapVisible)
{
MgdControlListView agentryVMMgdControlListView = sender as MgdControlListView;
//Action only when the Agentry item is selected
if (agentryVMMgdControlListView.SelectedItem != null && e.PropertyName.Equals("AgentrySelectedIndex"))
await RecenterSelectedWorkOrder();
}
else
{
isAutoRefreshNeeded = true;
}
}
private async Task RecenterSelectedWorkOrder()
{
if (mapControl != null)
{
orderNumber = viewModel.GetAgentryString(Globals.zIsSelected);
ApplicationViewModel vm = mapControl.DataContext as ApplicationViewModel;
MapView mapView = ((AgentryClientControls.EsriMap.EsriMapViewController)mapControl).mapView;
if (vm != null)
{
foreach (MapPointModel Point in vm.MapPoints)
{
if (!Point.IsAggregate && Point.Detail.Contains(orderNumber))
{
//if we are here then it is a match and hence assign it as selected map point
vm.SelectedMapPoint = Point;
MapPoint featureExtent = (MapPoint)((Esri.ArcGISRuntime.UI.Graphic)Point.GraphicIndicator).Geometry;
await mapView.SetViewpointAsync(new Viewpoint(featureExtent.Y,featureExtent.X,5000));
}
}
}
}
}