public static Task <TResult> InvokeAsync <TViewModel, TResult>(this ViewModel viewModel, Action <TViewModel, Page> activateAction, bool animation = true) where TViewModel : FunctionViewModel <TResult> { var helper = new InvokeHelper <TViewModel, TResult>(); viewModel.Navigation.PushAsync <TViewModel>( (vm, v) => { vm.Result = default(TResult); if (activateAction != null) { activateAction(vm, v); } helper.Attach(vm, v); }); return(helper.TaskCompletionSource.Task); }