Advertisement
Mateus_Costa

MainWindowViewModel

May 13th, 2020
1,676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.65 KB | None | 0 0
  1. Imports Prism.Commands
  2. Imports Prism.Mvvm
  3.  
  4. Friend Class [MainWindowViewModel]
  5.     Inherits BindableBase
  6.  
  7.     Private _num As Integer = 0
  8.  
  9.     Public Sub New()
  10.         MyCommand = New DelegateCommand(AddressOf MyCommandExecute)
  11.     End Sub
  12.  
  13.     Private _texto As Integer
  14.     Public Property Texto As Integer
  15.         Get
  16.             Return _texto
  17.         End Get
  18.         Set(ByVal value As Integer)
  19.             SetProperty(_texto, value)
  20.         End Set
  21.     End Property
  22.  
  23.     Public ReadOnly Property MyCommand As DelegateCommand
  24.  
  25.     Private Sub MyCommandExecute()
  26.         _num = _num + 1
  27.         Texto = _num.ToString()
  28.     End Sub
  29. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement