Reshape Online

This sample demonstrates using an ESRI.ArcGIS.Client.Tasks GeometryService that takes an input polyline graphic that cuts across a polygon graphic to generate a new polygon graphics that is reshaped to be smaller by the cutting polyline. To make this sample work requires a two step interaction of first selection and existing polygon via a mouse click and then drawing a polyline across the selected polygon. The Draw_Complete event in the code-behind uses If/Else logic to determine if the user is in the first step or the second step via the an ESRI.ArcGIS.Client Draw object to determine what drawing mode (Point, Polyline, Polygon, etc.) is being used.

To use the sample, (step 1) click to select a parcel polygon and (step 2) digitize a line that intersects the selected polygon. The start and/or end point of the line can be inside the polygon.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.Reshape"
    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">

        <Grid.Resources>
            <esri:SimpleLineSymbol x:Key="RedLineSymbol" Color="Red" Width="4" Style="Solid" />
            <esri:FillSymbol x:Key="BlueFillSymbol">
                <esri:FillSymbol.ControlTemplate>
                    <ControlTemplate x:Name="CustomPolygonTemplate">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames BeginTime="0" Duration="0" 
                                                                          Storyboard.TargetName="Element" 
                                                                          Storyboard.TargetProperty="(Fill).(Color)">
                                                <SplineColorKeyFrame KeyTime="0" Value="#6600FFFF"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Path x:Name="Element" Stroke="Red" Fill="#660000FF"
                                StrokeStartLineCap="Round" StrokeThickness="2" 
                                StrokeLineJoin="Round" StrokeEndLineCap="Round" />
                        </Grid>
                    </ControlTemplate>
                </esri:FillSymbol.ControlTemplate>
            </esri:FillSymbol>
            <sys:String x:Key="StartText">Click to select a parcel polygon.</sys:String>
            <sys:String x:Key="EndText">Digitize a line that intersects the selected polygon.  The start and/or end point of the line can be inside the polygon.</sys:String>
            <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" Extent="-83.3188395774275,42.61428312652851,-83.31295664068958,42.61670913269855" >
            <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" 
                Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
            <esri:GraphicsLayer ID="ParcelsGraphicsLayer" />
        </esri:Map>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
            <TextBlock x:Name="InfoTextBlock" Text="{StaticResource StartText}" 
                       Width="200" TextAlignment="Left" Margin="30,20,20,30" TextWrapping="Wrap" Foreground="Black" />
        </Grid>

    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014