예 : 예. "Debug | Any CPU"MenuItem 명령에는 프로젝트 컨텍스트 BuildProjectCommand에 대한 자체 BuildConfiguration 컨텍스트가 있습니다. 올바르게 수행하는 방법? FindAncestor를 사용하여이 작업을 이미 시도했지만 작동하지 않습니다. 예 : Command="{Binding Path=DataContext.BuildCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type MenuItem}}}"
WPF MenuItem : SubMenuItem 명령을 부모 MenuItem에 바인딩하는 방법
참조 사진 : 나는 빠른 프로토 타입을 만들었다 아래 바인딩이 예상대로 작동합니다
바인딩 팝업 메뉴 방식으로 인해 까다로운 얻을 수 있습니다 그들은 시각적 트리에서 "연결이 끊어져"있다면, 당신은 예상대로'DataContext'를 상속받지 않습니다. 비록 당신이 사용할 수있는 몇 가지 [트릭] (https://stackoverflow.com/questions/662164/wpf-context-menu-doesnt-bind-to-right-databound-item)이 있습니다. –