usingEsri.ArcGISRuntime.Geometry;usingEsri.ArcGISRuntime.Mapping;usingEsri.ArcGISRuntime.Xamarin.Forms;usingXamarin.Forms;namespaceFormsMapsShared{/// <summary>/// Binding helpers/// </summary>publicclassCommandBinder{/// <summary>/// This command binding allows you to set the extent on a mapView from your view-model through binding/// </summary>publicstaticEnvelopeGetRequestView(BindableObjectobj){return(Envelope)obj.GetValue(RequestViewProperty);}/// <summary>/// This command binding allows you to set the extent on a mapView from your view-model through binding/// </summary>/// <param name="obj"></param>/// <param name="extent"></param>publicstaticvoidSetRequestView(BindableObjectobj,Envelopeextent){obj.SetValue(RequestViewProperty,extent);}/// <summary>/// Identifies the ZoomTo Attached Property./// </summary>publicstaticreadonlyBindablePropertyRequestViewProperty=BindableProperty.CreateAttached(propertyName:"RequestView",returnType:typeof(Viewpoint),declaringType:typeof(CommandBinder),defaultValue:null,defaultBindingMode:BindingMode.OneWay,validateValue:null,propertyChanged:RequestViewPropertyChanged);privatestaticvoidRequestViewPropertyChanged(BindableObjectbindable,objectoldValue,objectnewValue){if(bindableisMapView){MapViewmapView=bindableasMapView;if(newValueisViewpoint){mapView.SetViewpoint((Viewpoint)newValue);}}}}}