Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    MeasurementCreateMode Class

    A measurement mode that allows users to create rulers.

    Namespace: DevExpress.Xpf.Map

    Assembly: DevExpress.Xpf.Map.v25.1.dll

    NuGet Package: DevExpress.Wpf.Map

    #Declaration

    public class MeasurementCreateMode :
        MeasurementModeBase

    #Remarks

    In this mode, users can click the map to create a ruler. They do not need to click the Measurements toolbar buttons.

    The following markup activates the Measurements object’s Create mode for the distance ruler:

    <dxm:MapControl.Measurements>
        <dxm:Measurements>
            <dxm:Measurements.Mode>
                 <dxm:MeasurementCreateMode/>
            </dxm:Measurements.Mode>
        </dxm:Measurements>
    </dxm:MapControl.Measurements>
    

    Specify the RulerType property to change the ruler type:

    <dxm:Measurements.Mode>
          <dxm:MeasurementCreateMode RulerType="Area"/>
    </dxm:Measurements.Mode>
    

    Use the SetCreateModeCommand to activate Create mode at runtime.

    You can also specify the Measurements.Mode property in code as follows:

    MeasurementCreateMode mode = new MeasurementCreateMode();
    mode.RulerType = RulerType.Area;
    mapControl1.Measurements.Mode = mode;
    

    The code above allows users to add an area ruler.

    See Also