public class ViewModel extends java.lang.Object implements IViewModel
ViewModel used in MVVM.| Constructor and Description |
|---|
ViewModel() |
ViewModel(java.lang.String title) |
| Modifier and Type | Method and Description |
|---|---|
<I,R> void |
bindCommand(ICommand<I,R> command)
Binds
command executing and errors of command to the receiver. |
void |
bindErrors(rx.Observable<IViewModelException> errorObservable)
Binds
errorsObservable to the receiver. |
void |
bindLoading(rx.Observable<java.lang.Boolean> loadingObservable)
Binds
loadingObservable to the receiver. |
IMutableProperty<java.lang.Boolean> |
getActive() |
rx.Observable<IViewModelException> |
getErrors()
An Observable of all errors that occur in the receiver.
|
IMutableProperty<java.lang.CharSequence> |
getTitle() |
IProperty<java.lang.Boolean> |
isEnabled() |
IProperty<java.lang.Boolean> |
isLoading() |
public IMutableProperty<java.lang.Boolean> getActive()
getActive in interface IViewModelpublic IMutableProperty<java.lang.CharSequence> getTitle()
getTitle in interface IViewModelpublic IProperty<java.lang.Boolean> isLoading()
isLoading in interface IViewModelpublic rx.Observable<IViewModelException> getErrors()
IViewModelgetErrors in interface IViewModelpublic IProperty<java.lang.Boolean> isEnabled()
isEnabled in interface IViewModelpublic void bindLoading(rx.Observable<java.lang.Boolean> loadingObservable)
IViewModelloadingObservable to the receiver.bindLoading in interface IViewModelloadingObservable - An Observable which sends true if loading, false otherwise.public void bindErrors(rx.Observable<IViewModelException> errorObservable)
IViewModelerrorsObservable to the receiver.bindErrors in interface IViewModelerrorObservable - An Observable which sends IViewModelException.public <I,R> void bindCommand(ICommand<I,R> command)
IViewModelcommand executing and errors of command to the receiver.
If command errors are not instanceof IViewModelException, these errors will not be forward from the receiver.bindCommand in interface IViewModel