You could use the following code.
Imports CommunityToolkit.Mvvm.ComponentModel
Imports CommunityToolkit.Mvvm.Input
Class MainWindow
End Class
Partial Public Class MainWindowVM
Inherits ObservableObject
Public Sub New()
Me.FirstLabel = "default value..."
Me.ExitMe = New RelayCommand(AddressOf exMe)
End Sub
<ObservableProperty>
Private fLabel As String
Public Property FirstLabel As String
Private Sub Save()
Me.fLabel = FirstLabel
End Sub
<RelayCommand>
Private Sub exMe()
Windows.Application.Current.Shutdown()
End Sub
Public ReadOnly Property ExitMe As ICommand
End Class
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.