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

Unable to bind to DynamicObject derived classes #105

Open
cornerbowlsoftware opened this issue Aug 31, 2024 · 3 comments
Open

Unable to bind to DynamicObject derived classes #105

cornerbowlsoftware opened this issue Aug 31, 2024 · 3 comments

Comments

@cornerbowlsoftware
Copy link

cornerbowlsoftware commented Aug 31, 2024

Describe the bug

In WPF I use DynamicObject so my POCOs that house raw data in value and display arrays can displayed and sorted properly. It's quite powerful in WPF allowing me to display any object into a DataGrid with my own column header and cell templates as defined by the complex datatypes in my generic POCOs. I also use the DynamicObject base class so I can dynamically update values in real-time. I ported my views to Avalonia, however the calls to TryGetMember are never called causing the view display empty values. This has already been documented here:

AvaloniaUI/Avalonia#12527

To Reproduce

Follow the link above, use the code in the post and bind a datagrid to the DynamicObject. Notice the TryGetMember is never called.

Expected behavior

The .Net class methods found in DynamicObject should be called.

Avalonia version

11.1.3

OS

Windows

Additional context

No response

@cornerbowlsoftware cornerbowlsoftware added the bug Something isn't working label Aug 31, 2024
@maxkatz6 maxkatz6 removed the bug Something isn't working label Sep 1, 2024
@rabbitism
Copy link
Contributor

You can create your own data binding plugin. Please check tutorial
https://github.com/irihitech/Avalonia-Tutorials/tree/main/Tutorials/DataGrid_With_ExpandoObject

@timunie
Copy link
Contributor

timunie commented Sep 1, 2024

@cornerbowlsoftware all links are missing for me. Can you double check that?

@cornerbowlsoftware
Copy link
Author

@cornerbowlsoftware all links are missing for me. Can you double check that?

Sorry about that I incorrectly had added the link. I have updated my question to include the link,

@MrJul MrJul transferred this issue from AvaloniaUI/Avalonia Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants