내 출력 창에이납니다 :WPF : 바인딩 오류를 어떻게 디버깅합니까?
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
이것은 실행이 나는 또한 Bea Stollnitz's article를 추천하려고했지만 조나단 알렌은 자신의 게시물을 가지고
<GroupBox Header="Grant/Deny Report">
<ListBox ItemsSource="{Binding Converter={StaticResource MethodBinder}, ConverterParameter=GrantDeny, Mode=OneWay}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Label Content="{Binding Entity}"/>
<Label Content="{Binding HasPermission}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
아니요, 아니요, 아니요. 흥미로운 점은 ItemsSource가 데이터 테이블이라는 것입니다. –
하지만 적어도 스타일 시트에 있음을 알기에 충분한 정보를 주셨습니다. –