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

Improve MVVM support for some Toolkit controls #498

Open
nCastle1 opened this issue Mar 16, 2023 · 1 comment
Open

Improve MVVM support for some Toolkit controls #498

nCastle1 opened this issue Mar 16, 2023 · 1 comment

Comments

@nCastle1
Copy link
Contributor

Search and FloorFilter both depend on setting a DataContext in the constructor. This doesn't work if there is an externally-set DataContext, which is quite common in MVVM scenarios.

The quick fix is to add a wrapping FrameworkElement in the control template, and explicitly set the DataContext to {x:Null}, then set the DataContext on the child.

@dotMorten
Copy link
Member

Custom controls should not set the datacontext anywhere, but instead use TemplateBinding.

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