martindevos

Hom do I stop the MeasureAction in xaml

Discussion created by martindevos on Jan 17, 2014
Latest reply on Jan 28, 2014 by dlednik-esristaff
Hi,

I have used the MeasureAction by attaching it to the click event of a button as shown in the SDK sample application.
But once activated, I can't stop it anymore. What is the correct way to do this.

This is the xaml :
                    <Button Content="Measure" Background="{StaticResource PanelGradient}" Foreground="White" Margin="2" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <esri:MeasureAction                                 
                                    AreaUnit="SquareMiles"
                                    DisplayTotals="True"
                                    DistanceUnit="Miles"
                                    MapUnits="Meters"
                                    MeasureMode="Polygon"                                  
                                    FillSymbol="{StaticResource DefaultFillSymbol}"
                                    TargetName="MyMap"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>

I have tried to Bind the IsEnabled property of the MeasureAction to a variable in my viewmodel, but that doesn't work.

Kind regards,

Martin

Outcomes