Template Picker

This sample demonstrates being able to add features and their associated attributes in two ArcGISLocalFeatureLayers using the ESRI.ArcGIS.Client.Toolkit TemplatePicker.

To use the sample, select a template from the picker, and draw a feature on the map. Modify attributes and click Apply to finish.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalTemplatePicker"
    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:sys="clr-namespace:System;assembly=mscorlib">
    <Grid x:Name="LayoutRoot" Background="White" >
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000" Background="#FFE3E3E3" MinimumResolution="2445.98490512499">
            <esri:ArcGISLocalTiledLayer ID="BaseMap" Path="..\\Data\\TPKs\\Topographic.tpk"/>
            <esri:ArcGISLocalFeatureLayer ID="PointsofInterest" Path="..\\Data\\MPKS\\PointsofInterest.mpk" LayerName="PointsofInterest" AutoSave="False" Editable="True" OutFields="*"></esri:ArcGISLocalFeatureLayer>
            <esri:ArcGISLocalFeatureLayer ID="Evacuation" Path="..\\Data\\MPKS\\PointsofInterest.mpk" LayerName="Evacuation" AutoSave="False" Editable="True" OutFields="*"></esri:ArcGISLocalFeatureLayer>
        </esri:Map>
        <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,15,15,0" Width="350" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10"  Canvas.Left="0" Canvas.Top="0" Width="352" Margin="0,0,-2,8" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,19" />
            <TextBlock x:Name="InformationText" Foreground="Black" Text="Select a template from the picker, and draw a feature on the map." 
                HorizontalAlignment="Center" VerticalAlignment="Top" TextAlignment="Left" Margin="30,20,20,30" TextWrapping="Wrap" />
        </Grid>
        <Border Background="{StaticResource PanelGradient}" BorderThickness="1" CornerRadius="5"
                        HorizontalAlignment="Right"  VerticalAlignment="Top"
                        Padding="5" BorderBrush="Black" Margin="5" >
            <Border.Effect>
                <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
            </Border.Effect>
            <esri:TemplatePicker x:Name="MyTemplatePicker" Map="{Binding ElementName=MyMap, Mode=OneWay}" 
                          Loaded="MyTemplatePicker_Loaded"/>
        </Border>
        <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
    </Grid>    
</UserControl>

      
Sample code usage restrictions
5/16/2014