As Reza Aghaei said, Databinding require property. You could refer to the following example.
<Window.DataContext>
<local:ViewModel />
</Window.DataContext>
<StackPanel>
<CheckBox IsChecked="{Binding Path=PrintList.AccountName}" />
<TextBox Text="{Binding PrintList.AccountName ,UpdateSourceTrigger=PropertyChanged ,Mode=TwoWay }"/>
</StackPanel>
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.Windows.Automation
Class MainWindow
End Class
Public Class ViewModel
Public Property PrintList() As Printing = New Printing()
Public Sub New()
PrintList.AccountName = True
End Sub
Public Class Printing
Implements INotifyPropertyChanged
Private _AccountName As Boolean = False
Public Property AccountName As Boolean
Get
Return Me._AccountName
End Get
Set(ByVal value As Boolean)
Me._AccountName = value
NotifyPropertyChanged("AccountName")
End Set
End Property
Public Property AccountNumber As Boolean
Public Property Expiration As Boolean
Public Property SecurityCode As Boolean
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private Sub NotifyPropertyChanged(ByVal propertyName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
End Sub
End Class
End Class
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.