viewmodel - Bind to IReactiveCommand in view code behind -
i have viewmodel has errorcommand. wish subscribe in view code behind time called can display error message passed so:
errorcommand.exectute("error occured")
in view:
this.whenany(view => x.viewmodel.errorcommand, x => x.value).subscribe(error => displayerror(error));
this code doesn't work shows i'm trying acheive. how correctly?
i understand use messagebus, have similar scenario messagebus wouldn't appropriate.
there's method scenario:
this.whenanyobservable(x => x.viewmodel.errorcommand).subscribe(x => /* ... */);
will expect , avoid null refs
Comments
Post a Comment