ArcGIS Runtime SDK for .NET Samples

Integrated Windows Authentication

Web map items from an IWA-secured portal

Loading

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.IntegratedWindowsAuth.IntegratedWindowsAuth"
             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">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="350" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Border Grid.Column="0"
            Background="LightGray" BorderBrush="Black" BorderThickness="0,0,2,0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="100"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Button x:Name="SearchPublicMapsButton"
                    Grid.Row="0"
                    Content="Search Public Maps"														
                    Width="265" Height="35"
                    Margin="0,50,0,0"
                    Click="SearchPublicMapsClick"/>
                <Grid Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Button x:Name="SearchSecureMapsButton" 
                            Grid.Row="1"
			                Content="Search IWA Secured Maps"													
			                Width="265" Height="35"
                            Click="SearchSecureMapsButtonClick"/>
                    <TextBox x:Name="SecurePortalUrlTextBox"
                             Grid.Row="0"
                             Margin="0,5"
                             Width="265" Height="20"/>
                    <TextBlock Grid.Row="0"
                               IsHitTestVisible="False" Text="Enter the URL to your secured portal" 
                               VerticalAlignment="Center" HorizontalAlignment="Left" Margin="50,5" 
                               Foreground="DarkGray">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Text, ElementName=SecurePortalUrlTextBox}" Value="">
                                        <Setter Property="Visibility" Value="Visible"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <CheckBox x:Name="RequireLoginCheckBox"
                              Grid.Row="2"
                              Margin="45,5"
                              IsChecked="False"
                              Content="Force login"/>
                </Grid>
                <ListBox x:Name="MapItemListBox"
                         Grid.Row="2"                  
                         FontSize="12"
                         Width="265" Height="150"
                         Margin="0,40,0,5"/>
                <Button x:Name="AddMapItem"
                        Grid.Row="3"
                        Content="Load Web Map"
                        Width="265" Height="35"
                        IsEnabled="False"
                        Click="AddMapItemClick"/>
                <StackPanel x:Name="MessagePanel"
			Grid.Row="4" 
                        Orientation="Vertical"							
			Margin="10">
                    <ScrollViewer>
                        <TextBlock x:Name="MessagesTextBlock" 
                        	Text="Using default system credentials." 
                                TextWrapping="Wrap"/>
                    </ScrollViewer>
                    <ProgressBar x:Name="ProgressStatus" 
			IsIndeterminate="True"
                        Visibility="Collapsed"/>
                </StackPanel>
            </Grid>
        </Border>

        <Grid x:Name="MyMapGrid"
              Grid.Column="1">
            <esri:MapView>
                <esri:Map>
                    <esri:ArcGISTiledLayer 
			Source="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
                </esri:Map>
            </esri:MapView>
        </Grid>
    </Grid>
</UserControl>


In this topic
  1. Code