|
|
@ -19,53 +19,53 @@ Intégration du toolkit au projet => Package MyToolkitMVVM :
|
|
|
|
|
|
|
|
|
|
|
|
classDiagram
|
|
|
|
classDiagram
|
|
|
|
|
|
|
|
|
|
|
|
class BaseViewModel~T~{
|
|
|
|
class BaseViewModel~T~{
|
|
|
|
+TModel Model
|
|
|
|
+TModel Model
|
|
|
|
-TModel model
|
|
|
|
-TModel model
|
|
|
|
+BaseViewModel(model: TModel)
|
|
|
|
+BaseViewModel(model: TModel)
|
|
|
|
+BaseViewModel():this(default(TModel))
|
|
|
|
+BaseViewModel():this(default(TModel))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class BaseViewModel{
|
|
|
|
class BaseViewModel{
|
|
|
|
+ BaseViewModel()
|
|
|
|
+ BaseViewModel()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class ObservableObject{
|
|
|
|
class ObservableObject{
|
|
|
|
+PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
+PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
#OnPropertyChanged(propertyName: string)
|
|
|
|
#OnPropertyChanged(propertyName: string)
|
|
|
|
#SetProperty~T~(member: T ref, value: T, propertyName: string)
|
|
|
|
#SetProperty~T~(member: T ref, value: T, propertyName: string)
|
|
|
|
#SetProperty~T~(member: T, value: T,action Action~T~, propertyName: string)
|
|
|
|
#SetProperty~T~(member: T, value: T,action Action~T~, propertyName: string)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class RelayCommand~T~ {
|
|
|
|
class RelayCommand~T~ {
|
|
|
|
+CanExecuteChanged: EventHandler
|
|
|
|
+CanExecuteChanged: EventHandler
|
|
|
|
-execute: Action<T>
|
|
|
|
-execute: Action<T>
|
|
|
|
-canExecute: Func<T, bool>
|
|
|
|
-canExecute: Func<T, bool>
|
|
|
|
+RelayCommand(Action<T> execute, Func<T, bool> canExecute)
|
|
|
|
+RelayCommand(Action<T> execute, Func<T, bool> canExecute)
|
|
|
|
+CanExecute(object? parameter): bool
|
|
|
|
+CanExecute(object? parameter): bool
|
|
|
|
+Execute(object? parameter): void
|
|
|
|
+Execute(object? parameter): void
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class RelayCommand {
|
|
|
|
class RelayCommand {
|
|
|
|
-execute: Action<object>
|
|
|
|
-execute: Action<object>
|
|
|
|
-canExecute: Func<object, bool>
|
|
|
|
-canExecute: Func<object, bool>
|
|
|
|
+RelayCommand(Action<object> execute, Func<object, bool> canExecute)
|
|
|
|
+RelayCommand(Action<object> execute, Func<object, bool> canExecute)
|
|
|
|
+Execute(): Task
|
|
|
|
+Execute(): Task
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class INotifyPropertyChanged{
|
|
|
|
class INotifyPropertyChanged{
|
|
|
|
<<interface>>
|
|
|
|
<<interface>>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class ICommand{
|
|
|
|
class ICommand{
|
|
|
|
<<interface>>
|
|
|
|
<<interface>>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RelayCommand --|> ICommand
|
|
|
|
RelayCommand --|> ICommand
|
|
|
|
ObservableObject --|> INotifyPropertyChanged
|
|
|
|
ObservableObject --|> INotifyPropertyChanged
|
|
|
|
BaseViewModel --|> ObservableObject
|
|
|
|
BaseViewModel --|> ObservableObject
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|