S57 CellInfo

This sample demonstrates adding and removing S-57 cells from an HydrographicS57Layer in the Map and accessing the Dataset Identification (DSID) metadata of those S-57 cells. The DSID metadata Provides information regarding the dataset's source and the product specification it is part of. The sample uses a ListBox control whose ItemSource property is bound to the Cells property of the HydrographicS57Layer instance. Other controls are bound to specific properties of the selected S57Cell instance to display the metadata values.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.S57CellInfo"
             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/client/2009"
             xmlns:local="clr-namespace:ArcGISWPFSDK">
    <Grid>
        <Grid.Resources>
            <Style TargetType="ListBoxItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Border x:Name="ItemBorder"
                                    BorderBrush="Black"
                                    Background="LightGray"
                                    BorderThickness="2"
                                    
                                    Margin="3">
                                <ContentPresenter Margin="2" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="ItemBorder"
                                            Property="BorderBrush"
                                            Value="Blue" />
                                </Trigger>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter TargetName="ItemBorder"
                                            Property="BorderBrush"
                                            Value="Red"/>
                                </Trigger>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsMouseOver" Value="False" />
                                        <Condition Property="IsSelected" Value="False" />
                                    </MultiTrigger.Conditions>
                                    <Setter TargetName="ItemBorder"
                                            Property="Opacity"
                                            Value="0.50" />
                                </MultiTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
           
        </Grid.Resources>
        <Grid>

            <esri:Map x:Name="MyMap"  UseAcceleratedDisplay="True" Extent="-15090086, 4141039, -13113925 , 5862778"
                     WrapAround="True" MinimumResolution="5">

                <esri:ArcGISTiledMapServiceLayer ID="Ocean_BaseMap"
                        Url="http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" />

                <esri:HydrographicS57Layer x:Name="S57Layer"  ID="S57Layer" Initialized="S57Layer_Initialized">
                    <esri:S57Cell Path="..\Data\s57_electronic_navigational_charts\US1WC01M\US1WC01M.000" />
                    <esri:S57Cell Path="..\Data\s57_electronic_navigational_charts\US1WC07M\US1WC07M.000" />
                </esri:HydrographicS57Layer>
                
            </esri:Map>

            <Grid Width="300" Height="440" Margin="5,5,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                <Rectangle Height="440" VerticalAlignment="Top" Fill="White" Stroke="Gray" >
                    <Rectangle.Effect>
                        <DropShadowEffect/>
                    </Rectangle.Effect>
                </Rectangle>
                <Rectangle Margin="5"  Fill="#DDFFFFFF" Stroke="DarkGray" />

                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Button Margin="10,15,0,0" x:Name="AddCellButton" Content="Add Cell(s)" Click="AddCellButton_Click" Height="30" Width="70" />
                        <Button Margin="5,15,0,0" x:Name="RemoveSelectedCellsButton" Content="Remove Selected" Click="RemoveSelectedCellsButton_Click" Height="30" Width="100"  />
                        <Button Margin="5,15,15,0" x:Name="ZoomToSelectedButtom" Content="Zoom to Selected" Click="ZoomToSelectedButtom_Click" Height="30" Width="100" />
                    </StackPanel>
                    <ScrollViewer Margin="10,5,10,0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto"  
                         Width="280" Height="140">
                        <ListBox x:Name="s57CellList" ItemsSource="{Binding Cells, ElementName=S57Layer}" 
                             MouseDoubleClick="s57CellList_MouseDoubleClick" SelectionChanged="s57CellList_SelectionChanged">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Margin="2">
                                        <TextBlock Text="{Binding Status, Mode=OneWay}"  />
                                        <TextBlock Text="{Binding Name, Mode=OneWay}" Margin="5,0,2,0" > 
                                <ToolTipService.ToolTip>
                                    <StackPanel MaxWidth="400">
                                        <TextBlock FontWeight="Bold" Text="{Binding Path}" TextWrapping="Wrap" />
                                    </StackPanel>
                                </ToolTipService.ToolTip>
                            </TextBlock>
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </ScrollViewer>
                    <Border Margin="10,5,10,0" BorderThickness="1" BorderBrush="Black" Background="White" Height="235" >
                        <StackPanel Margin="5,0,5,0" x:Name="cellInfoDisplay">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Name:</TextBlock>
                                <TextBlock Text="{Binding Name}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Path:</TextBlock>
                                <TextBlock Text="{Binding Path}" Margin="5,0,0,0" MaxWidth="240" TextWrapping="Wrap"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Status:</TextBlock>
                                <TextBlock Text="{Binding Status}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Agency:</TextBlock>
                                <TextBlock Text="{Binding Agency}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>ExchangePurpose:</TextBlock>
                                <TextBlock Text="{Binding ExchangePurpose}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Intended Usage:</TextBlock>
                                <TextBlock Text="{Binding IntendedUsage}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Edition Number:</TextBlock>
                                <TextBlock Text="{Binding EditionNumber}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Update Number:</TextBlock>
                                <TextBlock Text="{Binding UpdateNumber}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Update Application Date:</TextBlock>
                                <TextBlock Text="{Binding UpdateApplicationDate}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Issue Date:</TextBlock>
                                <TextBlock Text="{Binding IssueDate}" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock>Compilation Scale:</TextBlock>
                                <TextBlock Text="{Binding CompilationScale}" Margin="5,0,0,0"/>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014