Measurements.Mode Property
Gets or sets the mode that the Measurements object uses.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v24.2.dll
NuGet Package: DevExpress.Wpf.Map
#Declaration
public MeasurementModeBase Mode { get; set; }
#Property Value
Type | Description |
---|---|
Measurement |
The mode that the Measurements object uses. |
#Remarks
You can set this property to Create or Edit mode.
#Create Mode
In Create mode, users click the map to create a ruler. They do not need to click the Measurements toolbar buttons. Assign the MeasurementCreateMode object to the Mode property to activate this mode. Use the RulerType property to specify the ruler type.
In XAML:
<dxm:MapControl.Measurements>
<dxm:Measurements>
<dxm:Measurements.Mode>
<dxm:MeasurementCreateMode RulerType="Area"/>
</dxm:Measurements.Mode>
</dxm:Measurements>
</dxm:MapControl.Measurements>
In code:
MeasurementCreateMode mode = new MeasurementCreateMode();
mode.RulerType = RulerType.Area;
mapControl1.Measurements.Mode = mode;
#Edit Mode
Edit mode allows users to change map rulers. To activate this mode, set the Mode property to the MeasurementEditMode object.
In XAML:
<dxm:MapControl.Measurements>
<dxm:Measurements>
<dxm:Measurements.Mode>
<dxm:MeasurementEditMode/>
</dxm:Measurements.Mode>
</dxm:Measurements>
</dxm:MapControl.Measurements>
In code:
The following actions are available in Edit mode:
Action | Description |
---|---|
Add a ruler point. | Click the position on the ruler where you wish to add a point. |
Change the ruler polyline. | Click and drag the point to a new location. |
Delete a ruler point. | Double-click the ruler point. |
The image below shows how to change a distance ruler: