Access parent DataContext from DataTemplate
I have a ListBox which binds to a child collection on a ViewModel. The listbox items are styled in a datatemplate based on a property on the parent ViewModel: <Style x:Key="curveSpeedNonConstantParameterCell"> <Style.Triggers> <DataTrigger Binding="{Binding Path=DataContext.CurveSpeedMustBeSpecified, ElementName=someParentElementWithReferenceToRootDataContext}" Value="True"> <Setter Property="Control.Visibility" Value="Hidden"></Setter> </DataTrigger> </Style.Triggers> </Style> I get the following output error: System.Windows.Data Error: 39 : BindingExpression path error: