Created
December 7, 2013 05:43
-
-
Save KatsuYuzu/7837680 to your computer and use it in GitHub Desktop.
C#からの変換依頼
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System.Windows.Input | |
Imports System.ComponentModel | |
Namespace CounterApp_CS | |
Public NotInheritable Class CounterViewModel | |
Implements INotifyPropertyChanged | |
Public Sub New() | |
counter_ = New CounterComponent.Counter() | |
AddHandler counter_.PropertyChanged, | |
Sub(sender, e) | |
If e.PropertyName = "Count" Then | |
RaisePropertyChanged(e.PropertyName) | |
End If | |
End Sub | |
End Sub | |
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged | |
Public ReadOnly Property Count As Integer | |
Get | |
Return counter_.Count | |
End Get | |
End Property | |
Public ReadOnly Property Increment As ICommand | |
Get | |
Return New Common.RelayCommand( | |
Sub() | |
counter_.Increment() | |
End Sub) | |
End Get | |
End Property | |
Public ReadOnly Property Decrement As ICommand | |
Get | |
Return New Common.RelayCommand( | |
Sub() | |
counter_.Decrement() | |
End Sub) | |
End Get | |
End Property | |
Private Sub RaisePropertyChanged(propertyName As String) | |
Dim handle = PropertyChangedEvent | |
If handle IsNot Nothing Then | |
handle(Me, New PropertyChangedEventArgs(propertyName)) | |
End If | |
End Sub | |
Private counter_ As CounterComponent.Counter | |
End Class | |
End Namespace |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment