hi all, i'm trying to utilize the measure action in code behind. i've got a button that will show a user control with two radio buttons to choose the measure mode (distance or area) then a combo box to select the untis (dependent on the measure mode). i'd like to 1) instantiate (if that's the correct word) the behavior in code behind and 2) have the measuring action persist for as long as the user control window is open. not sure how to go about doing those, so any help would be appreciated. here is what i have so far. also, how do i set the TargetName property of the Measure action? Partial Public Class Measure
Inherits UserControl
Private m As New ESRI.ArcGIS.Client.Actions.MeasureAction
Public Shared ReadOnly MapProperty As DependencyProperty = DependencyProperty.Register("Map", GetType(ESRI.ArcGIS.Client.Map), GetType(Measure), Nothing)
Public Property Map() As ESRI.ArcGIS.Client.Map
Get
Return DirectCast(GetValue(MapProperty), ESRI.ArcGIS.Client.Map)
End Get
Set(ByVal value As ESRI.ArcGIS.Client.Map)
SetValue(MapProperty, value)
End Set
End Property
Public Sub New()
InitializeComponent()
m.AreaUnit = ESRI.ArcGIS.Client.Actions.AreaUnit.SquareMiles
m.DistanceUnit = ESRI.ArcGIS.Client.Actions.DistanceUnit.Feet
m.MapUnits = ESRI.ArcGIS.Client.Actions.DistanceUnit.Meters
m.LineSymbol = DefaultLineSymbol
m.FillSymbol = DefaultFillSymbol
m.DisplayTotals = True
m.MeasureMode = ESRI.ArcGIS.Client.Actions.MeasureAction.Mode.Polyline
End Sub
Private Sub cbUnits_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs)
'ToDo
End Sub
Private Sub RadioButton_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
'ToDo
End Sub
End Class
lance