2011-12-15 5 views
0

コントロールのisEnabledプロパティが設定されているときにカスタムの一部の内部要素を持つSilverlight UserControlを作成しました。グレーアウト)。他のプロパティでは、DependencyPropertyを設定してそこでコードを実行しますが、これはisEnabledには呼び出されません(既に宣言されているため)。コードは以下の通りです。userControlの設定での内部コンポーネントのカスタム機能 "isEnabled"

public static readonly DependencyProperty EnabledProperty = 
DependencyProperty.Register("isEnabled", typeof(bool), typeof(BreadcrumbElement), null); 

    public bool isEnabled 
    { 
     get { return (bool)GetValue(TitleProperty); } 
     set 
     { 
      SetValue(TitleProperty, value); 
      if (value) 
       Chevron.Source = new BitmapImage(new Uri("../Resources/ChevronRight.png", UriKind.Relative)); 
      else 
       Chevron.Source = new BitmapImage(new Uri("../Resources/ChevronRight_Disabled.png", UriKind.Relative)); 

     } 
    } 

私は何かの代わりにisEnabledを使用したいので、これを正しく機能させる方法はありますか?あなたがでIsEnabledをバインドする場所のおかげ:)

+0

XAMLを追加してください。 –

答えて

関連する問題