Back to Devexpress

Parameter.Value Property

corelibraries-devexpress-dot-diagram-dot-core-dot-shapes-dot-parameter-ffdd25e3.md

latest4.8 KB
Original Source

Parameter.Value Property

Specifies the current value of the parameter.

Namespace : DevExpress.Diagram.Core.Shapes

Assembly : DevExpress.Diagram.v25.2.Core.dll

NuGet Package : DevExpress.Diagram.Core

Declaration

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

Property Value

TypeDescription
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.

xml
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.

xml
<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.

xml
<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:

The following code snippets (auto-collected from DevExpress Examples) contain references to the Value property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

diagramcontrol-how-to-create-custom-shapes-with-connection-points-using-xaml-markup-t381372/CS/XtraDiagram.CreateCustomShapesXaml/DiagramResources.xaml#L53

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

wpf-diagramdesigner-create-custom-shapes-with-connection-points/CS/DXDiagram.CreateCustomShapes/CustomShapes.xaml#L52

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

wpf-diagram-use-custom-functions-in-shape-templates/CS/WpfApp13/CustomShapes.xaml#L25

xml
Point="CreatePoint((COS(P) + 1)/2*W, (SIN(P) + 1)/2*H)"
Value="atn2(P.Y/H*2-1, P.X/W*2-1)"
Min="-3.14" Max="3.14" />

See Also

Parameter Class

Parameter Members

DevExpress.Diagram.Core.Shapes Namespace