次のようなXAMLツリーがあります。
<Window>
<Grid>
<DockPanel>
<DataGrid>
<DataGrid.Resources>
<CheckBox Command="{Binding Command}" CommandParameter="??" />
</DataGrid.Resources>
</DataGrid>
<StackPanel>
<ChartLegend>
</ChartLegend>
<DataChart>
</DataChart>
</stackPanel>
</DockPanel>
</Grid>
</Window>
onからonのようにDataChart
オブジェクトが欲しいです。CommandParameter
ViewModel
Command
DataGrid
私の調査結果:
DockPanel
オブジェクトをとして取得しているので、CommandParameter
メソッドFindName("")
を適用してを取得する必要がありDataChart
ます。そして、さらに変更を加えます。
しかし、ツリーを回避または検索するために、DataChart
オブジェクトを直接必要とします。TypeCasting