ArcGISRuntime.WPF.Samples.DisplayDeviceLocation.DisplayDeviceLocation.OnModeChooserSelectionChanged C# (CSharp) Метод

OnModeChooserSelectionChanged() приватный Метод

private OnModeChooserSelectionChanged ( object sender, System e ) : void
sender object
e System
Результат void
        private void OnModeChooserSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            // Get index that is used to get the selected url
            var selectedIndex = _navigationTypes.ToList().IndexOf(modeChooser.SelectedValue.ToString());

            switch (selectedIndex)
            {
                case 0:
                    // Starts location display with auto pan mode set to Off
                    MyMapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Off;

                    //TODO Remove this IsStarted check https://github.com/Esri/arcgis-runtime-samples-xamarin/issues/182
                    if (!MyMapView.LocationDisplay.IsEnabled)
                        MyMapView.LocationDisplay.IsEnabled = true;
                    break;

                case 1:
                    // Starts location display with auto pan mode set to Re-center
                    MyMapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Recenter;

                    //TODO Remove this IsStarted check https://github.com/Esri/arcgis-runtime-samples-xamarin/issues/182
                    if (!MyMapView.LocationDisplay.IsEnabled)
                        MyMapView.LocationDisplay.IsEnabled = true;
                    break;

                case 2:
                    // Starts location display with auto pan mode set to Navigation
                    MyMapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.Navigation;

                    //TODO Remove this IsStarted check https://github.com/Esri/arcgis-runtime-samples-xamarin/issues/182
                    if (!MyMapView.LocationDisplay.IsEnabled)
                        MyMapView.LocationDisplay.IsEnabled = true;
                    break;

                case 3:
                    // Starts location display with auto pan mode set to Compass Navigation
                    MyMapView.LocationDisplay.AutoPanMode = LocationDisplayAutoPanMode.CompassNavigation;

                    //TODO Remove this IsStarted check https://github.com/Esri/arcgis-runtime-samples-xamarin/issues/182
                    if (!MyMapView.LocationDisplay.IsEnabled)
                        MyMapView.LocationDisplay.IsEnabled = true;
                    break;
            }
        }
    }