Skip to content

[Question] GetValue for abstract AvaloniaProperty<T> #3508

@jp2masa

Description

@jp2masa

I noticed some projects using Avalonia expose property definitions as AvaloniaProperty<T> instead of the concrete type (StyledProperty, DirectProperty,...), so there are some calls to GetValue for those properties which no longer work after #3255 and #3287 (the resolved overload is the one taking AvaloniaProperty, which returns untyped value, i.e. object).

So my question is whether it's incorrect to expose properties as AvaloniaProperty<T>, and if not, if it would make sense to provide a GetValue<T>(AvaloniaProperty<T> property) method in AvaloniaObject in order not to break those usages.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions