Boolean 値を指定して、BindableAttribute クラスの新しいインスタンスを初期化します。
名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文
'宣言
Public Sub New ( _
bindable As Boolean _
)
'使用
Dim bindable As Boolean
Dim instance As New BindableAttribute(bindable)
public BindableAttribute (
bool bindable
)
public:
BindableAttribute (
bool bindable
)
public BindableAttribute (
boolean bindable
)
public function BindableAttribute (
bindable : boolean
)
パラメータ
- bindable
プロパティをバインディングに使用する場合は true。それ以外の場合は false。
解説
BindableAttribute に true を設定してプロパティをマークすると、この属性の値は定数メンバ Yes に設定されます。false に設定された BindableAttribute でマークしたプロパティの場合、値は No になります。したがって、コード内でこの属性の値を確認する場合は、この属性を BindableAttribute.Yes または BindableAttribute.No として指定する必要があります。
使用例
プロパティがデータのバインド先として適切であることをマークするコード例を次に示します。このコード例では、新しい BindableAttribute を作成し、その値を BindableAttribute.Yes に設定してから、その属性をプロパティに関連付けます。
<Bindable(true)> _
Public Property MyProperty As Integer
Get
' Insert code here.
Return 0
End Get
Set
' Insert code here.
End Set
End Property
[Bindable(true)]
public int MyProperty {
get {
// Insert code here.
return 0;
}
set {
// Insert code here.
}
}
public:
[property:Bindable(true)]
property int MyProperty
{
int get()
{
// Insert code here.
return 0;
}
void set( int theValue )
{
// Insert code here.
}
}
/** @attribute Bindable(true)
*/
/** @property
*/
public int get_MyProperty()
{
// Insert code here.
return 0;
} //get_MyProperty
/** @property
*/
public void set_MyProperty(int value)
{
// Insert code here.
} //set_MyProperty
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0
参照
関連項目
BindableAttribute クラス
BindableAttribute メンバ
System.ComponentModel 名前空間
BindableAttribute クラス