Home Dashboard Directory Help
Search

ContentPresenter ignores DataContext by Bruno Martinez


Status: 

Active


8
0
Sign in
to vote
Type: Bug
ID: 560183
Opened: 5/19/2010 12:58:20 PM
Access Restriction: Public
1
Workaround(s)
view
2
User(s) can reproduce this bug

Description

A Binding set on ContentPresenter.Content does not pick the DataContext set on the ContentPresenter itself. This works when the DataContext is set on the parent of the ContentPresenter.

WPF behaves the same way. I suspect Silverlight 4 changed to match WPF. It brakes old code that I think worked before.
Details
Sign in to post a comment.
Posted by Microsoft on 5/19/2010 at 5:05 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Siderite on 6/21/2011 at 12:44 AM
Try using ContentSource instead of Content. Especially inside templates.