Skip to content

Instantly share code, notes, and snippets.

View robibobi's full-sized avatar

Tobias Höfer robibobi

View GitHub Profile
@robibobi
robibobi / AsyncCommand.cs
Last active November 30, 2016 18:00
Blog "Asynchrone Command Pattern im MVVM-Stil" auf http://thecolorofcode.com/
class AsyncCommand<TParam> : AsyncCommandBase
{
readonly Func<CancellationToken, TParam, Task> _command;
readonly Func<TParam, bool> _canExecuteFunc;
readonly CancelAsyncCommand _cancelCommand;
public AsyncCommand(Func<CancellationToken, TParam, Task> command)
{
_command = command;
_canExecuteFunc = _ => true;