2011-03-30 5 views
0

내 종속성 속성이 컨트롤에 바인딩되지 않았습니다.IsEnable 내 컨트롤의 속성이 xaml에서 바인딩되지 않습니다.

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

해결 된 해당 페이지의 DataContext를 설정 한 후 .

관련 문제