對不起,如果這個問題是雙重的地方,我搜查但沒有找到。用INotifyPropertyChanged綁定到我的課
我創建了我自己的課程。
Public Class MyListService
Implements INotifyPropertyChanged
Public Event PropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Private Sub OnPropertyChanged(ByVal Title As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(Title))
End Sub
Private _IsLoggedIn As Boolean = False
Public Property IsLoggedIn As Boolean
Get
Return _IsLoggedIn
End Get
Set(value As Boolean)
If _IsLoggedIn <> value Then
_IsLoggedIn = value
Call OnPropertyChanged("IsLoggedIn")
End If
End Set
End Property
End Class
在WPF項目,我在代碼隱藏
Private WithEvents cWebService As new MyListService
在XAML:
<CheckBox IsChecked="{Binding IsLoggedIn}" x:Name="chkIsLoggedIn" />
請你能告訴我如何綁定的是 「IsLoggedIn」財產現在複選框?
Regards
您應該閱讀[基本](http://msdn.microsoft.com/en-us/library/ms752347.aspx#creating_a_binding)... – 2012-03-10 02:03:29