Unable to set binding with PolyLineSegment.Points property
Posted: 11 Nov 2022, 15:07
Hello. I'm trying to implement sort of a painting utility, which allows a user to draw continuous line with mouse. To implement that I'm creating a viewmodel with `ICollection<Noesis.Point> Points` property and bind it in xaml in following way:
However, I can't get it to work, and all I get is an error in log:
Other properties in my view are bound correctly, so it's not a simple DataContext or binding path issue. I found an existing bug in bugtracker (https://www.noesisengine.com/bugs/view.php?id=2308) about the same exact issue, but it's marked as solved in version 3.1.4, and it's indeed the version I'm using. Any help is appreciated.
Code: Select all
<DataTemplate DataType="{x:Type vm:PolyLineViewModel}">
<Path
StrokeEndLineCap="Round"
StrokeLineJoin="Round"
StrokeStartLineCap="Round"
StrokeThickness="{Binding LineThickness}">
<Path.Stroke>
<SolidColorBrush Color="{Binding Color}" />
</Path.Stroke>
<Path.Data>
<PathGeometry>
<PathFigure x:Name="clipFigure" IsClosed="{Binding IsClosed}">
<PathFigure.Segments>
<PolyLineSegment Points="{Binding Points}" />
</PathFigure.Segments>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
</DataTemplate>
Code: Select all
[NOESIS/E] Binding failed: Path=Points, Source=Brio.MRS.PhotoEditor.ViewModels.PolyLineViewModel(''), Target=PolyLineSegment(''), TargetProperty=PolyLineSegment.Points