Skip to content

v12.1.0 breaks compiled bindings / reduces type safety #21833

Description

@JaggerJo

Describe the bug

We just tried to move from 12.0.x to 12.1 and now have a bunch of build errors related to the change made in #21617

Previously it was supported to bind commands to methods with a concrete parameter type, not it's required to be an object.

 Error AVLN2000 Avalonia: Unable to resolve method of name 'CopyTextToClipBoardCommand' on type 'ViewModel'.Expected method with no parameters or a single object overload.

This previously worked and made the method in the view model type safe:

Image Image

With 12.1 we need to check if the parameter is actually of type string and change the CopyTextToClipBoardCommand method to take an object.

I get that this change was made intentionally - I just think this should be reconsidered.

To Reproduce

Create a command binding to a method that takes a non object parameter

Expected behavior

No response

Avalonia version

12.1

OS

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions