Silverlight: How to bind to parent view's DataContext?
问题 I have a ParentView that contains a childView <UserControl ... x:Name="MyParentView"> <Grid> <sdk:TabControl Name="ContactTabControl"> <sdk:TabItem Header="Contact" Name="CustomerTabItem"> <Grid> <Views:CustomerView/> </Grid> </sdk:TabItem> </sdk:TabControl> </Grid> </UserControl> Within my CustomerView I would like to bind the Firstname textbox to Parent's DataContext. I have tried this inside the CustomerView: <TextBox Text={Binding ElementName=MyParentView, Path=DataContext.Firstname} /> I