我的依赖属性没有绑定在控件中。
public bool EnableMe
{
get { return (bool)GetValue(EnableMeProperty); }
set { SetValue(EnableMeProperty, value); }
}
public static readonly DependencyProperty EnableMeProperty =
DependencyProperty.Register("EnableMe", typeof(bool), typeof(OwnwrClasss), new PropertyMetadata(null));
<Button IsEnabled="{Binding Source=EnableMe}" >
<Image Source="/Images/icon.png" x:Name="btnShow"/>
<Button>
我想动态启用和禁用此按钮。
答案 0 :(得分:0)
解决, 在设置该页面的DataContext之后。