Find a route

Route and driving directions
Loading

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.FindRoute.FindRoute"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
             xmlns:networkAnalysis="clr-namespace:Esri.ArcGISRuntime.Tasks.NetworkAnalysis;assembly=Esri.ArcGISRuntime">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border Background="WhiteSmoke" Opacity=".85" BorderBrush="Black" BorderThickness="1"
                HorizontalAlignment="Left" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="375">
            <StackPanel>
                <TextBlock Text="Route directions:"
                           Margin="0,0,0,2"
                           FontWeight="SemiBold" />
                <ListBox x:Name="DirectionsListBox"
                         HorizontalAlignment="Stretch"
                         ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                         Height="300">
                    <ListBox.ItemTemplate>
                        <DataTemplate DataType="networkAnalysis:DirectionManeuver">
                            <TextBlock Text="{Binding DirectionText}" TextWrapping="Wrap" />
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <Button x:Name="SolveRouteButton"
                        HorizontalAlignment="Stretch"
                        Height="30"
                        Margin="0,5"
                        Content="Solve Route"
                        Click="SolveRouteClick" />
                <Button x:Name="ResetButton"
                        HorizontalAlignment="Stretch"
                        Height="30"
                        Content="Reset"
                        Click="ResetClick" />
            </StackPanel>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code