wpf-devexpress-dot-xpf-dot-map-dot-measurements-975d9008.md
Gets or sets the mode that the Measurements object uses.
Namespace : DevExpress.Xpf.Map
Assembly : DevExpress.Xpf.Map.v25.2.dll
NuGet Package : DevExpress.Wpf.Map
public MeasurementModeBase Mode { get; set; }
Public Property Mode As MeasurementModeBase
| Type | Description |
|---|---|
| MeasurementModeBase |
The mode that the Measurements object uses.
|
You can set this property to Create or Edit 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;
Dim mode As MeasurementCreateMode = New MeasurementCreateMode()
mode.RulerType = RulerType.Area
mapControl1.Measurements.Mode = 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:
mapControl1.Measurements.Mode = new MeasurementEditMode();
mapControl1.Measurements.Mode = New MeasurementEditMode()
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:
See Also