I have developed a measuring tool by utilizing a custom layout template. I went this route because I liked the functionality of seeing the measurements on individual line segments. I also created a quick add-in that allows the Measuring Panel to be opened and closed but it is not necesary. Yuo can change the visibility of the MeasureBox Data Grid to Visible and it will remian open all the time. I've included a picture of this tool.[ATTACH=CONFIG]14300[/ATTACH]Custom Layout Measuring Code<Grid x:Name="MeasureBox" HorizontalAlignment="Right" VerticalAlignment="Top" Width="Auto" Height="Auto" Margin="10" Visibility="Collapsed">
<Border Style="{StaticResource GlassyBorder}" Padding="10,3,10,3" Opacity="1">
<StackPanel >
<TextBlock Text="Measuring Tools" Foreground="White" FontSize="14" FontWeight="Bold" Margin="4" />
<TextBlock Text="Select Units:" Foreground="White" FontSize="12" Margin="2" />
<ComboBox x:Name="UnitCombo" Foreground="White" Margin="0,0,0,4" >
<ComboBox.Items>
<ComboBoxItem Content="Feet" IsSelected="True" Foreground="Black"/>
<ComboBoxItem Content="Meters" Foreground="Black"/>
<ComboBoxItem Content="Miles" Foreground="Black"/>
</ComboBox.Items>
</ComboBox>
<ComboBox x:Name="AreaCombo" Foreground="White">
<ComboBox.Items>
<ComboBoxItem Content="SquareFeet" IsSelected="True" Foreground="Black"/>
<ComboBoxItem Content="SquareMeters" Foreground="Black"/>
<ComboBoxItem Content="SquareMiles" Foreground="Black"/>
</ComboBox.Items>
</ComboBox>
<Rectangle Margin="0,10,0,10" Fill="White" Height="2" HorizontalAlignment="Stretch" />
<Button Margin="0,0,0,2"
Content="Length(Line)" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esri:MeasureAction
AreaUnit="{Binding ElementName=AreaCombo, Path=SelectedItem.Content}"
DisplayTotals="True"
DistanceUnit="{Binding ElementName=UnitCombo, Path=SelectedItem.Content}"
MapUnits="Meters"
MeasureMode="Polyline"
FillSymbol="{StaticResource DefaultFillSymbol}"
TargetName="Map"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Margin="0,2,0,2"
Content="Radius(Circle)" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esri:MeasureAction
AreaUnit="{Binding ElementName=UnitCombo, Path=SelectedItem.Content}"
DisplayTotals="True"
DistanceUnit="{Binding ElementName=UnitCombo, Path=SelectedItem.Content}"
MapUnits="Meters"
MeasureMode="Radius"
FillSymbol="{StaticResource DefaultFillSymbol}"
TargetName="Map"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Margin="0,2,0,2"
Content="Area(Polygon)" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esri:MeasureAction
AreaUnit="{Binding ElementName=AreaCombo, Path=SelectedItem.Content}"
DisplayTotals="True"
DistanceUnit="{Binding ElementName=UnitCombo, Path=SelectedItem.Content}"
MapUnits="Meters"
MeasureMode="Polygon"
FillSymbol="{StaticResource DefaultFillSymbol}"
TargetName="Map"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Border>
</Grid>
Code in Add-In to toggle toll on/off Measuring tool in layout.namespace MeasurementTool.AddIns
{
[Export(typeof(ICommand))]
[DisplayName("Measuring Tools")]
[ESRI.ArcGIS.Client.Extensibility.Description("Click to show or hide measuring tools.")]
public class ToggleLayoutObject : ICommand
{
private FrameworkElement objectToToggle;
public bool CanExecute(object parameter)
{
return true;
}
public event EventHandler CanExecuteChanged;
public void Execute(object parameter)
{
if (objectToToggle == null)
objectToToggle = MapApplication.Current.FindObjectInLayout("MeasureBox") as FrameworkElement;
if (objectToToggle != null)
objectToToggle.Visibility = objectToToggle.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
}
}
}