-
Notifications
You must be signed in to change notification settings - Fork 779
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
Bind before setting content #98
Comments
It's a possibility, my only concern here is that we're already seeing some weird behavior such as #92 when the visual tree is collapsed, if the view isn't in the true visual tree then I worry it would exacerbate this. |
@nigel-sampson #98 is this issue :) I understand this can have an impact on conventions. |
You're right, I'm an idiot, the issue I was referring to was #92. I may need to some experiments to check the behaviour of |
Have run into a timing issue in #349 where this approach solved the problem. Mostly due to the lack of |
Hello,
When using
cal:View.Model
, I think the view should be bound to the VM before the control is assigned the view. Basically, it means swapping the calls toSetContentProperty
andViewModelBinder.Bind
in View.cs:292.Why? I'm currently getting "temporary" binding errors because when the view is initially created, the parent DataContext is used - just before being set correctly at the next line. Additionally, this improves performance since there is no DataContext changes: the various controls don't have to be completely bound twice.
I'm using WPF in .NET 4.5.
Note: I'm currently working around this problem by setting the data context in
ViewLocator.LocateForModel
, but it feels hacky.The text was updated successfully, but these errors were encountered: