private void DisableDrawObject(object sender, RoutedEventArgs e)
{
MyDrawObject.IsEnabled = false;
}
<Button Style="{StaticResource MenuItem}" Click="DisableDrawObject"
Content="Measure" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esriBehaviors:MeasureAction
AreaUnit="SquareMiles"
DisplayTotals="True"
DistanceUnit="Miles"
MapUnits="DecimalDegrees"
MeasureMode="Polygon"
FillSymbol="{StaticResource DefaultFillSymbol}"
TargetName="MyMap"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
The problem is that when you select the 'ZoomIn' button and then the 'Measure' button, the 2 tools are active and are listening to map click event (==> random result depending on event order).
When you click on the measure tool you need to disable the other tools.
Example : add this code:private void DisableDrawObject(object sender, RoutedEventArgs e) { MyDrawObject.IsEnabled = false; }
And call it when the user clicks the measure button:<Button Style="{StaticResource MenuItem}" Click="DisableDrawObject" Content="Measure" > <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <esriBehaviors:MeasureAction AreaUnit="SquareMiles" DisplayTotals="True" DistanceUnit="Miles" MapUnits="DecimalDegrees" MeasureMode="Polygon" FillSymbol="{StaticResource DefaultFillSymbol}" TargetName="MyMap"/> </i:EventTrigger> </i:Interaction.Triggers> </Button>