Skip to content

Added data-binding to a bool property#1

Open
dchaib wants to merge 1 commit intoshiftkey:masterfrom
dchaib:master
Open

Added data-binding to a bool property#1
dchaib wants to merge 1 commit intoshiftkey:masterfrom
dchaib:master

Conversation

@dchaib
Copy link
Copy Markdown

@dchaib dchaib commented Nov 23, 2014

As discussed, I will try to implement a custom binding to a checkbox.

API:

this.BindCheckBox(ViewModel, x => x.MyProperty, x => x.MyCommand);

where MyProperty was a bool and MyCommand was a ReactiveCommand.

The binding changes would be handled separate to the events (in theory), but exceptions should be propagated through the command rather than you managing the state of the checkbox yourself.

ReactiveCommand has a .ThrownExceptions property which is an observable stream of exceptions so you can handle those things separate to the actual command. If your error handling runs from that, it should make your code simpler. You just need to throw an exception from your command callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant