Created
September 6, 2013 14:35
-
-
Save kirkshoop/6464689 to your computer and use it in GitHub Desktop.
ReactiveCommand async registration and subscription
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
from(enable->RegisterAsyncFunction( | |
[](RoutedEventPattern) | |
{ | |
// background thread | |
// enable and disable commands will be disabled until this is finished | |
std::this_thread::sleep_for(std::chrono::seconds(2)); | |
return true; | |
})) // this is a subscription to the enable ReactiveCommand | |
// back on the ui thread | |
.subscribe([this](bool) // takes whatever was returned above | |
{ | |
// update the ui | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment