Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindings uses only "dynamic" properties when DataGrid item inherited from IReflectableType #15867

Open
BreakByBrick opened this issue May 30, 2024 · 2 comments

Comments

@BreakByBrick
Copy link

Describe the bug

Hello!

I'm trying to use IReflectableType to bind to "dynamic" properties. I read about them here:
#5225
#8119

In particular, I'm trying to implement a binding to the "dynamic" properties of DataGrid items. And I came across this behavior: when an element type inherits from IReflectableType, the search for a property to bind is performed only among "dynamic" properties.

I have datagrid with 3 columns. Frist and second columns bound to "regular" properties, Third column bound to "dynamic" property.

image

  1. When item type not inherited from IReflectableType, only "regular" properties are displaying.

image

image

  1. When item type inherited from IReflectableType, only "dynamic" properties are displaying.

image

image

To Reproduce

https://github.com/BreakByBrick/Avalonia.Issue/tree/main/DataGrid.DynamicPropertyBinding

Expected behavior

I think that when an element type inherits from IReflectableType, it should use both "regular" and "dynamic" properties.

Avalonia version

11.0.10

OS

Windows

Additional context

No response

@maxkatz6
Copy link
Member

It doesn't seem to be strictly related to DataGrid, might be a common behavior for any Binding in Avalonia.

This behavior should be compared with other XAML frameworks. But meanwhile, I hope, it should be easy to workaround by passing non-dynamic properties through IReflectableType as well.

@BreakByBrick
Copy link
Author

Referring to the original issue about ICustomTypeDescriptor support (#5225), I will assume that IReflectableType should work similarly to ICustomTypeDescriptor in WPF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants