0
我有一個XAML樹如下:UI對象,在XAML樹samelevel,作爲CommandParameter
<Window>
<Grid>
<DockPanel>
<DataGrid>
<DataGrid.Resources>
<CheckBox Command="{Binding Command}" CommandParameter="??" />
</DataGrid.Resources>
</DataGrid>
<StackPanel>
<ChartLegend>
</ChartLegend>
<DataChart>
</DataChart>
</stackPanel>
</DockPanel>
</Grid>
</Window>
我想有對象CommandParameter
上ViewModel
從Command
上DataGrid
。
我的發現:
我越來越DockPanel
對象作爲CommandParameter
,然後我需要去申請方法FindName("")
得到。並做進一步的修改。
但我想要對象直接,以避免TypeCasting
或搜索樹。
這是XamDataChart的一個主要缺點,即ItemSource無法通過Binding更新,因爲它是ReadOnly屬性。它只能通過帶UI控制的代碼進行更新。 –
但是這樣做的工作? –
只適用於它。會更新你。 –