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

InvalidCastException to IDock #349

Closed
Andreysht opened this issue Jul 30, 2024 · 1 comment
Closed

InvalidCastException to IDock #349

Andreysht opened this issue Jul 30, 2024 · 1 comment

Comments

@Andreysht
Copy link

Version: 11.1.0.1
App: DockMvvmSample

<Style Selector="ItemsControl > ContentPresenter"> applied to all matching children items in a tree. Not all of them are IDock.
This causes exceptions and binding errors listed below in DockMvvmSample application:

[Binding]An error occurred binding 'Proportion' to 'Proportion' at 'Proportion': 'Could not find a matching property accessor for 'Proportion' on 'Dock.Model.Mvvm.Controls.ProportionalDockSplitter'.' (ContentPresenter #45182569)
Exception thrown: 'System.InvalidCastException' in Dock.Avalonia.dll
[Binding]An error occurred binding '(unknown)' to 'IsCollapsable' at 'IsCollapsable': 'Unable to cast object of type 'Dock.Model.Mvvm.Controls.ProportionalDockSplitter' to type 'Dock.Model.Core.IDock'.' (ContentPresenter #45182569)
Exception thrown: 'System.InvalidCastException' in Dock.Avalonia.dll
[Binding]An error occurred binding '(unknown)' to 'IsEmpty' at 'IsEmpty': 'Unable to cast object of type 'Dock.Model.Mvvm.Controls.ProportionalDockSplitter' to type 'Dock.Model.Core.IDock'.' (ContentPresenter #45182569)

It could be fixed by adding name to the selector:

<Style Selector="ItemsControl#ProportionalDockControlItemsControl > ContentPresenter">

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