Skip to content

Polygon and Polyline Points binding problem #3623

Description

@DannyVlasenko

Avalonia 0.9.3

Xaml:

<Polygon Fill="Red" Points="{Binding DeltaPoints}"/>
<Polyline Stroke="Blue" Points="{Binding DeltaPoints}"/>

C#:

private readonly ReadOnlyObservableCollection<Avalonia.Point> _deltaPoints;
public ReadOnlyObservableCollection<Avalonia.Point> DeltaPoints => _deltaPoints;
private SourceList<Avalonia.Point> _pointsD;

_pointsD = new SourceList<Avalonia.Point>();
            _pointsD.Add(new Avalonia.Point(123, 45));
            _pointsD.Add(new Avalonia.Point(45, 45));
           ...
            _pointsD.Connect()
                .ObserveOn(RxApp.MainThreadScheduler)
                .Bind(out _deltaPoints)
                .Subscribe();

These bindings work only for the initial points collection. All dynamically added points change neither Polygon nor Polyline image. Binding of the same collection to a ListBox works well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions