나는 창에 들어있는 목록 (아래 참조)을 가지고있다. 창 DataContext
에는 Items
과 AllowItemCommand
의 두 가지 속성이 있습니다.WPF Databinding : "부모"데이터 컨텍스트에 어떻게 액세스합니까?
Hyperlink
의 Command
속성이 창 DataContext
에 대해 해결해야하는 바인딩을 얻으려면 어떻게해야합니까?
...Binding="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type Window}}, Path=DataContext.AllowItemCommand}" ...
디버거에 들어가서 UI가 빌드되는 시점까지 단계별로 진행할 수 있습니까? 그렇다면 변수에 들어가서 드릴을 시도 할 수 있습니다 –
간단한 솔루션 (Windows 8 Store/Metro 앱에서도 작동)은 다음과 같습니다. [http://stackoverflow.com/questions/15366609/how-to-access- 부모 - datacontext-in-window-8-store-apps/15419382 # 15419382] (http://stackoverflow.com/questions/15366609/how-to-access-parents-datacontext-in-window-8-store-apps/15419382 # 15419382) – LMK