A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
Hi Roger,
you must check constructors in RelayCommand class. RelayCommand class can look like this:
Public Class RelayCommand
Implements ICommand
#Region "Fields"
' delegate to execute
Private ReadOnly _execute As Action(Of Object)
Private ReadOnly _canExecute As Predicate(Of Object)
#End Region ' Fields
#Region "Constructors"
''' <summary>
''' in ctor get delegate to execute
''' </summary>
''' <param name="execute">The execution logic.</param>
Public Sub New(ByVal execute As Action(Of Object))
Me.New(execute, Nothing)
End Sub
...
Parameter in AddressOf must be only the name of method (without parantheses)
Private ReadOnly Property _AddVehicle As New RelayCommand(AddressOf OnAddVehicle)
Public ReadOnly Property AddVehicle As RelayCommand
Get
Return _AddVehicle
End Get
End Property
''' <summary>
''' There's no constructor in RelayCommand class with this signature and method is not necessary
''' </summary>
Private Sub OnAddVehicle()
''
End Sub
''' <summary>
''' This method work for RelayCommand class
''' </summary>
''' <param name="par"></param>
Private Sub OnAddVehicle(par As Object)
''
End Sub