I would like to dynamically create a Path that is made up of several BezierSegments.
I would like to bind the data such that my data source only needs to provide numbers.
i.e. the app shouldn’t create any geometry objects in the code.
Is this possible?
Update:
Here’s an example for a fixed number of path segments:
<Path Stroke="Black">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint ="{Binding CalculatedPointA, Mode=OneWay}">
<LineSegment Point="{Binding CalculatedPointB, Mode=OneWay}" />
<LineSegment Point="{Binding CalculatedPointC, Mode=OneWay}" />
<LineSegment Point="{Binding CalculatedPointA, Mode=OneWay}" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
I’d like to have a variable number of segments.
The answer to your actual question is: No its not possible to bind data in such away to to dynamically create path figures or segements without using code (or using an additional component where some third-party has written code).
Is this question driven by the desire to not write code if not necessary or do have reason to believe that you shouldn’t be?