Parameter.Value Property

Specifies the current value of the parameter.

Namespace: DevExpress.Diagram.Core.Shapes

Assembly: DevExpress.Diagram.v20.1.Core.dll

Declaration

public CriteriaOperator Value { get; set; }
Public Property Value As CriteriaOperator

Property Value

Type Description
CriteriaOperator

A numerical value that is the current value of the parameter.

Remarks

Each parameter is characterized by its Value property. The Parameter.DefaultValue property returns the initial value.

To pass the current Parameter.Point to the Parameter.Value definition, use the P.X and P.Y variables that correspond to the point's X and Y coordinates.


Value="P.Y / H" 

The code snippet below illustrates how to define a parameter that changes its value from 0 to 1 depending on its current Y coordinate. An end-user cannot change the X coordinate.


<Parameter DefaultValue="0" 
                       Point="CreatePoint(W / 2, P * H)" 
                       Value="P.Y / H" 
                       Min="0" Max="1" />

You can pass the parameter's value to the CreateSize method. The P0 variable corresponds to the first parameter within the ShapeTemplate.Parameters collection, the P1 corresponds to the second parameter and so on. The code snippet below illustrates how to use this parameter to allow an end-user to transform the shape by changing the Arc segment's size.


<ShapeTemplate x:Key="{ShapeKey CustomizableArc}" DefaultSize="60, 120">
        <Start X="0" Y="0" FillColor="Green"/>
        <Arc X="1" Y="0" Size="CreateSize(W/2, P0 * H)" Direction="Counterclockwise" />
        <Line X="1" Y="1"/>
        <Line X="0" Y="1"/>
        <Line X="0" Y="0"/>
        <ShapeTemplate.Parameters>
            <Parameter DefaultValue="0" 
                       Point="CreatePoint(W / 2, P * H)" 
                       Value="P.Y / H" 
                       Min="0" Max="1" />
        </ShapeTemplate.Parameters>
    </ShapeTemplate>

The following image shows the result:

shape_transform_parameter

See Also