Hi all,I want to change the cursor from hand shape to arrow shape when doing measure action. I have changed the measure action from XAML to code-behind.
private void Measure_Click(object sender, System.Windows.RoutedEventArgs e)
{
MyMap.Cursor = Cursors.Arrow; //change the cursor to arrow shape
MyMeasureAction m = new MyMeasureAction(); //initialize a MyMeasureAction class
m.MeasureMode = ESRI.ArcGIS.Client.Actions.MeasureAction.Mode.Polygon; //MeasureMode is polygon
m.DisplayTotals = false; //do not display total distance
m.FillSymbol = LayoutRoot.Resources["DrawFillSymbol"] as FillSymbol;
m.DistanceUnit = ESRI.ArcGIS.Client.Actions.DistanceUnit.Feet;
m.MapUnits = ESRI.ArcGIS.Client.Actions.DistanceUnit.Feet; //the unit of the map is Feet
m.Attach(MyMap); //bind this action to MyMap
m.Execute(); //execute this action
}
But the weird thing is when I hit the button, the cursor cannot be changed to arrow shape. If I put this line under other button click events. It works.
MyMap.Cursor = Cursors.Arrow;
I guess this might due to the measure action itself? In the sample, it use hand cursor to perform measure action. Is there any method to change the cursor shape? Thank you! 🙂