ListBoxItem의 콘텐츠의 IsEnabled 속성에 따라 ListBox 항목을 사용하지 않도록 설정하려고합니다. 이 코드에서와 같이 버튼 1에는 IsEnabled = False가 있지만 목록 상자 항목을 선택할 수 있습니다. 내용 IsEnabled 속성이 false 인 경우 선택을 비활성화하려고합니다. 아이템 컨텐트와 IsEnabled 속성을 어떻게 검색해야 하는가?ListBoxItem에서 트리거에 대해 자식 컨트롤의 IsEnabled 속성을 찾는 방법
<Grid>
<ListBox>
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="IsEnabled" Value="False"/>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBoxItem>
<Button IsEnabled="False">1</Button>
</ListBoxItem>
<ListBoxItem>
<Button>2</Button>
</ListBoxItem>
<ListBoxItem>
<Button>3</Button>
</ListBoxItem>
</ListBox>
</Grid>
의 속성에 바인딩 할 수 있습니다. 그러나 이것은 내가 달성하기를 원하는 것이 아닙니다. 자식 컨트롤의 IsEnabled 속성을 가져 오려고합니다. MVVM을 사용하고 있지만 리소스 사전에있는 스타일로 트리거를 사용하고 싶습니다. – DronBoard