読み取り専用の依存関係プロパティ
public static readonly DependencyPropertyKey PropertyNamePropertyKey =
DependencyProperty.RegisterReadOnly ("PropertyName", typeof (PropertyType), typeof (OwnerClass),
new FrameworkPropertyMetadata (DefaultValue));
public static readonly DependencyProperty PropertyNameProperty = PropertyNamePropertyKey.DependencyProperty;
public PropertyType PropertyName
{
get { return (PropertyType) GetValue (PropertyNameProperty); }
}
内部的に値を設定する際には、下記のようにする。
SetValue (PropertyNamePropertyKey, NewValue);
トラックバック
- このエントリーにトラックバック:
- http://frog.raindrop.jp/cgi-bin/mt/mt-tb.cgi/2148
コメント