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 cast object of type 'DockXamlSample.ViewModels.UserControlItemViewModel' to type 'Dock.Model.Core.IDockable'. #376

Open
IldarKhayrutdinov opened this issue Dec 10, 2024 · 2 comments

Comments

@IldarKhayrutdinov
Copy link

IldarKhayrutdinov commented Dec 10, 2024

I use own hierarchy of data models without Dock models. Binding as described #228 (comment).
Add items data to model of ItemsControl throws exception (for each item):

Unable to cast object of type 'DockXamlSample.ViewModels.UserControlItemViewModel' to type 'Dock.Model.Core.IDockable'.

   at CompiledAvaloniaXaml.XamlIlHelpers.Dock.Model.Core.IDockable,Dock.Model.IsCollapsable!Getter(Object)
   at Avalonia.Data.Core.ClrPropertyInfo.Get(Object target)
   at Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindings.InpcPropertyAccessor.get_Value()
   at Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindings.InpcPropertyAccessor.SendCurrentValue()

The exceptions are suppressed and the window displays normally, but causes delays. There is no error when using ListBox.
Similar to #349, but on latest master throws.

Reproduction example:
DockXamlSample.zip
or https://github.com/IldarKhayrutdinov/Dock/tree/ItemsControl-Exception

@wieslawsoltes
Copy link
Owner

What version did you use?

@IldarKhayrutdinov
Copy link
Author

The latest master revision at issue created time 9b5a3a3.
The current master version 371b790 also reproduces.

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

2 participants