Want to Bind strokeDashArray Property using multiple Scenario

I Want to Bind strokeDashArray Property using multiple Scenario like link selected property or Depends on Some Link data Property.

I am try below code but not work:

new go.Binding("strokeDashArray","isSelected",
        (sel,shp)=>sel ==true? [0,0]:shp.part.data.edgedetails.linestyletype=="dashed_dotted"?[3, 2]:[0,0]),

When you don’t want there to be any dashes, use null as the value of Shape.strokeDashArray, not [0,0].
Shape | GoJS API

I am using null value for strokeDashArray but it still not works dash links not generated.

Binding Property I am using:

new go.Binding(“strokeDashArray”,“isSelected”,
(sel,shp)=>sel == true? null: shp.part.data.edgedetails.linestyletype == “dashed_dotted”? [3, 2]: null),

Don’t you also have a Binding whose target is “strokeDashArray” and whose source is “edgedetails” with a conversion to get its “linestyletype” property?

I want to bind StrokeDashArray Property Based on two Different Properties is there any way for that?

It’s probably easiest to use the empty string as the source property name – the conversion function will be passed a reference to the whole data object rather than the value of any property.

Can u please provide Example Like these.

new go.Binding(“strokeDashArray”,“isSelected”,
(sel,shp)=>sel ==true? [0,0]:shp.part.data.edgedetails.linestyletype==“dashed_dotted”?[3, 2]:[0,0]),

I don’t know which two properties you wanted the Shape.strokeDashArray to depend on, or how. I’ll guess:

new go.Binding("strokeDashArray", "", data => data.edgedetails.linestyletype == "dashed_dotted" ? data.edgedetails.array : null)

Default Shape.strokeDashArray is null.

  1. If data => data.edgedetails.linestyletype == “dashed_dotted” Then I want to set
    Shape.strokeDashArray is [3,2].
  2. IF Property isSelected ==True Then I Want to set Shape.strokeDashArray is null.

Your logic is incomplete – there are at least three cases. What do you want for the third case?

new go.Binding("strokeDashArray", "", (d, shp) => {
  if (d.edgedetails && d.edgedetails.linestyletype === "dashed_dotted") return [3, 2];
  if (shp.part.isSelected) return null;
  return null;