Skip To Content ArcGIS for Developers Sign In Dashboard

Edit feature attachments

Editing attachments for a feature

Loading

<UserControl x:Class="ArcGISRuntime.WPF.Samples.EditFeatureAttachments.EditFeatureAttachments"
             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>
        <esri:MapView x:Name="MyMapView" />
        <Border Style="{StaticResource BorderStyle}">
            <Grid>
                <StackPanel Orientation="Vertical">
                    <Label Content="Tap features to select."
                           HorizontalContentAlignment="Center"
                           FontWeight="SemiBold" />
                    <ListBox x:Name="AttachmentsListBox"
                             IsEnabled="False"
                             MinHeight="100"
                             MaxHeight="300"
                             HorizontalContentAlignment="Stretch"
                             Background="LightGray">
                        <!-- ItemTemplate defines how each item (Attachment) is rendered. -->
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Label Content="{Binding Name}" />
                                    <!-- DataTemplate sets the item as the button's DataContext automatically. -->
                                    <Button Content="Download"
                                            Grid.Column="1"
                                            HorizontalAlignment="Right"
                                            Padding="5" Margin="0,0,5,0"
                                            Click="DownloadAttachment_Click" />
                                    <Button Content="Delete"
                                            Grid.Column="2"
                                            HorizontalAlignment="Right"
                                            Padding="5"
                                            Click="DeleteAttachment_Click" />
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <Button x:Name="AddAttachmentButton"
                            Content="Add attachment"
                            IsEnabled="False"
                            Margin="0,5,0,5"
                            Click="AddAttachment_Click" />
                    <ProgressBar x:Name="ActivityIndicator"
                                 IsIndeterminate="True"
                                 Visibility="Collapsed"
                                 Height="15" />
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>

In this topic
  1. Code