【发布时间】:2015-12-06 11:32:08
【问题描述】:
我的telerik:GridViewDataColumn.CellTemplate xaml 中有带有DataTemplate 的按钮。
我想将 xaml 中的 IsEnabled 属性绑定到我的视图模型中的道具。
我的道具在 viewmodel 中填充了正确的值,但没有显示 xaml 中的更改。如何做到这一点?
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Button Content="Edit"
VerticalAlignment="Center"
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView }},Path=DataContext.SendDateCommand}"
CommandParameter="{Binding}" IsEnabled="{Binding IsSetSendDate,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
【问题讨论】:
-
调试程序时输出窗口是否有绑定失败?
-
@Mahsa Dehghanpour 为什么要使用 Mode=OneWay,我认为它必须是 TwoWay...