-
Notifications
You must be signed in to change notification settings - Fork 775
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
Some bindings not working in TabControl #92
Comments
It's certainly an interesting bug, I'm still looking at what the ultimate cause is. It's definitely something around the collapsed nature of the view as removing the |
If you enable wpf binding tracing, you will see this error in the debug output window: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=Root'. BindingExpression:Path=DataContext.AllSelected; DataItem=null; target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1') Most likely, because of the collapsed view and WPF visual/logical tree and binding magic. If you implement the BindingProxy from http://stackoverflow.com/questions/15494226/cannot-find-source-for-binding-with-reference-relativesource-findancestor and replace ElementName binding with:
it works. (I just tested it using your example project) I tried to find the issue within caliburn micro, but I have no clue where to start looking for this. Anyone else? |
I've updated the link to sample because it was deleted from the old link. |
I've edited the title because the issue is not in ElementName bindings: I have changed the source of a binding to |
Hello!
I've noticed an issue when using
Caliburn.Micro
to connectViews
andViewModels
inTabControl
. Some of theElementName
bindings are not working, and what's interesting is that it happens only if there are more than one tab inTabControl
.I have this issue in many places in my application, and I am attaching a sample application with one of this issues: https://drive.google.com/open?id=0B4RWnYweQI-GVUk1SUVGTmxkZ0E
In this sample there are two
TabControls
: left one is usingCaliburn.Micro
and the right one is using standard implicitDataTemplates
. I've simulated tab's loading, so tab's contents are shown after a slight delay.Steps to reproduce:
TabControls
.TabControl
is broken, but is working in the right one. This confirms that it isCaliburn.Micro
's issue.I think that it has something to do with a fact that the tab's
View
is collapsed during initialization.Please fix this issue: I want to use
Caliburn.Micro
's capabilities of wiringViews
andViewModels
instead of writing implicitDataTemplates
.The text was updated successfully, but these errors were encountered: